24 lines
828 B
C#
24 lines
828 B
C#
using Company.Domain.FineAgg;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
using System;
|
|
using _0_Framework.Application;
|
|
|
|
namespace CompanyManagment.EFCore.Mapping;
|
|
|
|
public class FineMapping:IEntityTypeConfiguration<Fine>
|
|
{
|
|
public void Configure(EntityTypeBuilder<Fine> builder)
|
|
{
|
|
builder.ToTable("Fines");
|
|
builder.HasKey(x => x.id);
|
|
|
|
builder.Property(x => x.IsActive).HasConversion(
|
|
v => v.ToString(),
|
|
v => (IsActive)Enum.Parse(typeof(IsActive), v)).HasMaxLength(5);
|
|
builder.Property(x => x.Title).HasMaxLength(255);
|
|
|
|
builder.Property(x => x.CreatedByUserType).HasConversion<string>().HasMaxLength(50);
|
|
builder.Property(x => x.LastModifiedByUserType).HasConversion<string>().HasMaxLength(50);
|
|
}
|
|
} |