32 lines
1.2 KiB
C#
32 lines
1.2 KiB
C#
using Company.Domain.FinancialTransactionAgg;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace CompanyManagment.EFCore.Mapping;
|
|
|
|
public class FinancialTransactionMapping : IEntityTypeConfiguration<FinancialTransaction>
|
|
{
|
|
public void Configure(EntityTypeBuilder<FinancialTransaction> builder)
|
|
{
|
|
builder.ToTable("FinancialTransactions");
|
|
builder.HasKey(x => x.id);
|
|
|
|
builder.Property(x => x.TdateFa);
|
|
builder.Property(x => x.TdateFa).HasMaxLength(10);
|
|
builder.Property(x => x.TypeOfTransaction).HasMaxLength(10);
|
|
builder.Property(x => x.DescriptionOption).HasMaxLength(50);
|
|
builder.Property(x => x.Description).HasMaxLength(600);
|
|
builder.Property(x => x.Deptor);
|
|
builder.Property(x => x.Creditor);
|
|
builder.Property(x => x.TdateFa);
|
|
builder.Property(x => x.Balance);
|
|
builder.Property(x => x.SentSms);
|
|
builder.Property(x => x.MessageText).HasMaxLength(255);
|
|
builder.Property(x => x.SentSmsDateFa).HasMaxLength(10);
|
|
|
|
builder.HasOne(x => x.FinancialStatment)
|
|
.WithMany(x => x.FinancialTransactionList)
|
|
.HasForeignKey(x => x.FinancialStatementId);
|
|
|
|
}
|
|
} |