Add CustDocBase64 entity and integrate into DbContext

Introduce a new entity class `CustDocBase64` mapped to the
`TBCUST_DOC_BASE64` table in the `dbo` schema. This class includes
properties for various document attributes. Update `TaskFlowDbContext`
to include a `DbSet<CustDocBase64>` for querying and interacting with
the table. Configure the entity in `OnModelCreating` to have no key
and map it to the appropriate table and schema.
This commit is contained in:
2026-10-27 15:45:31 +01:00
parent 569bf360e6
commit e00be89d1a
2 changed files with 43 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
using System.ComponentModel.DataAnnotations.Schema;
namespace DigitalData.TaskFlow.Domain.Entities;
[Table("TBCUST_DOC_BASE64", Schema = "dbo")]
public sealed class CustDocBase64
{
[Column("ProcessID", TypeName = "bigint")]
public long? ProcessId { get; set; }
[Column("DocID", TypeName = "bigint")]
public long? DocId { get; set; }
[Column("Doctype", TypeName = "nvarchar(200)")]
public string? DocType { get; set; }
[Column("GroupType", TypeName = "nvarchar(200)")]
public string? GroupType { get; set; }
[Column("filename", TypeName = "nvarchar(500)")]
public string? FileName { get; set; }
[Column("filebase64", TypeName = "varchar(max)")]
public string? FileBase64 { get; set; }
[Column("ADDED_WHEN", TypeName = "datetime")]
public DateTime AddedWhen { get; set; }
[Column("thumbnailbase64", TypeName = "varchar(max)")]
public string? ThumbnailBase64 { get; set; }
}

View File

@@ -1,3 +1,4 @@
using DigitalData.TaskFlow.Domain.Entities;
using DigitalData.TaskFlow.Infrastructure.Persistence.Models;
using Microsoft.EntityFrameworkCore;
@@ -13,6 +14,11 @@ public sealed class TaskFlowDbContext(DbContextOptions<TaskFlowDbContext> option
/// </summary>
public DbSet<WorkflowListingReadModel> WorkflowListingReadModels => Set<WorkflowListingReadModel>();
/// <summary>
/// Gets the keyless entity mapped to TBCUST_DOC_BASE64.
/// </summary>
public DbSet<CustDocBase64> CustDocBase64 => Set<CustDocBase64>();
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
@@ -22,5 +28,11 @@ public sealed class TaskFlowDbContext(DbContextOptions<TaskFlowDbContext> option
entity.HasNoKey();
entity.ToView(null);
});
modelBuilder.Entity<CustDocBase64>(entity =>
{
entity.HasNoKey();
entity.ToTable("TBCUST_DOC_BASE64", "dbo");
});
}
}