SHA256
- Created models for DB and DTOs: StayExportFile - Added required db migrations. - Added StayExportService and StayExportServiceFactory for stay exporting services. - Added configuration options required for StayExport.
33 lines
867 B
C#
33 lines
867 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
using Somnia.GuestLog.Models.Entities;
|
|
|
|
namespace Somnia.GuestLog.Infrastructure.EntityConfigs;
|
|
|
|
public class StayExportFileEntityConfig : IEntityTypeConfiguration<StayExportFile>
|
|
{
|
|
public void Configure(EntityTypeBuilder<StayExportFile> builder)
|
|
{
|
|
builder.ToTable("StayExportFile");
|
|
|
|
//PK
|
|
builder.HasKey(e => e.Id);
|
|
|
|
builder.Property(e => e.Id)
|
|
.IsRequired()
|
|
.UseIdentityByDefaultColumn();
|
|
|
|
builder.ComplexProperty(e => e.ExportParams, e =>
|
|
{
|
|
e.ToJson();
|
|
});
|
|
|
|
builder.Property(e => e.ExportedPath)
|
|
.HasMaxLength(256);
|
|
|
|
|
|
builder.Property(e => e.ExportTime)
|
|
.IsRequired()
|
|
.HasColumnType(DbConsts.DbType_Timestamptz);
|
|
}
|
|
} |