21 lines
687 B
C#
21 lines
687 B
C#
namespace LiteCharms.Entities.Configuration;
|
|
|
|
public class PackageItemConfiguration : IEntityTypeConfiguration<PackageItem>
|
|
{
|
|
public void Configure(EntityTypeBuilder<PackageItem> builder)
|
|
{
|
|
builder.ToTable(nameof(PackageItem));
|
|
|
|
builder.HasKey(f => f.Id);
|
|
builder.Property(f => f.CreatedAt).IsRequired().ValueGeneratedOnAdd();
|
|
builder.Property(f => f.PackageId).IsRequired();
|
|
builder.Property(f => f.ProductPriceId).IsRequired();
|
|
builder.Property(f => f.Active);
|
|
|
|
builder.HasOne(f => f.Package)
|
|
.WithMany()
|
|
.HasForeignKey(f => f.PackageId)
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
}
|
|
}
|