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:
@@ -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; }
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using DigitalData.TaskFlow.Domain.Entities;
|
||||||
using DigitalData.TaskFlow.Infrastructure.Persistence.Models;
|
using DigitalData.TaskFlow.Infrastructure.Persistence.Models;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
@@ -13,6 +14,11 @@ public sealed class TaskFlowDbContext(DbContextOptions<TaskFlowDbContext> option
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public DbSet<WorkflowListingReadModel> WorkflowListingReadModels => Set<WorkflowListingReadModel>();
|
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)
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
base.OnModelCreating(modelBuilder);
|
base.OnModelCreating(modelBuilder);
|
||||||
@@ -22,5 +28,11 @@ public sealed class TaskFlowDbContext(DbContextOptions<TaskFlowDbContext> option
|
|||||||
entity.HasNoKey();
|
entity.HasNoKey();
|
||||||
entity.ToView(null);
|
entity.ToView(null);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity<CustDocBase64>(entity =>
|
||||||
|
{
|
||||||
|
entity.HasNoKey();
|
||||||
|
entity.ToTable("TBCUST_DOC_BASE64", "dbo");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user