using ODMO.Commons.DTOs.Digimon; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace ODMO.Infrastructure.ContextConfiguration.Digimon { public class DigimonDigicloneConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder .ToTable("Digiclone", "Digimon") .HasKey(x => x.Id); builder .Property(x => x.ATLevel) .HasColumnType("tinyint") .HasDefaultValue(byte.MinValue) .IsRequired(); builder .Property(x => x.ATValue) .HasColumnType("smallint") .HasDefaultValue(0) .IsRequired(); builder .Property(x => x.BLLevel) .HasColumnType("tinyint") .HasDefaultValue(byte.MinValue) .IsRequired(); builder .Property(x => x.BLValue) .HasColumnType("smallint") .HasDefaultValue(0) .IsRequired(); builder .Property(x => x.CTLevel) .HasColumnType("tinyint") .HasDefaultValue(byte.MinValue) .IsRequired(); builder .Property(x => x.CTValue) .HasColumnType("smallint") .HasDefaultValue(0) .IsRequired(); builder .Property(x => x.EVLevel) .HasColumnType("tinyint") .HasDefaultValue(byte.MinValue) .IsRequired(); builder .Property(x => x.EVValue) .HasColumnType("smallint") .HasDefaultValue(0) .IsRequired(); builder .Property(x => x.HPLevel) .HasColumnType("tinyint") .HasDefaultValue(byte.MinValue) .IsRequired(); builder .Property(x => x.HPValue) .HasColumnType("smallint") .HasDefaultValue(0) .IsRequired(); builder .HasOne(x => x.History) .WithOne(x => x.DigimonDigiclone) .HasForeignKey(x => x.DigimonDigicloneId); } } }