using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore; using ConcursoProjetos.Domain.Entities; namespace ConcursoProjetos.Data.Configurations; public class CandidatoConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.ToTable("Candidato"); builder.HasKey(p => p.Id); builder.Property(p => p.Id) .ValueGeneratedOnAdd(); builder.Property(p => p.IsDeleted) .HasColumnType("bit"); builder.Property(p => p.Cpf) .HasColumnType("nvarchar") .HasMaxLength(11); builder.Property(p => p.NomeCompleto) .HasColumnType("nvarchar") .HasMaxLength(100); builder.Property(p => p.Telefone) .HasColumnType("nvarchar") .HasMaxLength(20); builder.Property(p => p.Email) .HasColumnType("nvarchar") .HasMaxLength(100); builder.Property(p => p.TipoPessoa) .HasColumnType("bit"); builder.Property(p => p.Cnpj) .HasColumnType("nvarchar") .HasMaxLength(14); builder.Property(p => p.EmpresaRazaoSocial) .HasColumnType("nvarchar") .HasMaxLength(100); builder.Property(p => p.EmpresaTelefone) .HasColumnType("nvarchar") .HasMaxLength(20); builder.Property(p => p.EmpresaEmail) .HasColumnType("nvarchar") .HasMaxLength(100); builder.HasOne(c => c.User) .WithMany() .HasForeignKey(c => c.UserId) .OnDelete(DeleteBehavior.Restrict); } }