using ODMO.Commons.DTOs.Shop; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace ODMO.Infrastructure.ContextConfiguration.Shop { public class ConsignedShopConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder .ToTable("ConsignedShop", "Shop") .HasKey(x => x.Id); builder .Property(x => x.ShopName) .HasColumnType("varchar") .HasMaxLength(30) .IsRequired(); builder .Property(x => x.Channel) .HasColumnType("tinyint") .HasDefaultValue(byte.MinValue) .IsRequired(); builder .Property(x => x.ItemId) .HasColumnType("int") .HasDefaultValue(0) .IsRequired(); builder .Property(x => x.GeneralHandler) .HasColumnType("int") .IsRequired(); builder .HasOne(x => x.Location) .WithOne(x => x.ConsignedShop) .HasForeignKey(x => x.ConsignedShopId); } } }