26 lines
981 B
C#
26 lines
981 B
C#
using Company.Domain.RollCallEmployeeAgg;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace CompanyManagment.EFCore.Mapping;
|
|
|
|
public class RollCallEmployeeMapping : IEntityTypeConfiguration<RollCallEmployee>
|
|
{
|
|
public void Configure(EntityTypeBuilder<RollCallEmployee> builder)
|
|
{
|
|
builder.ToTable("RollCallEmployees");
|
|
builder.HasKey(x => x.id);
|
|
|
|
builder.Property(x => x.WorkshopId);
|
|
builder.Property(x => x.EmployeeId);
|
|
builder.Property(x => x.EmployeeFullName).HasMaxLength(100);
|
|
builder.Property(x => x.FName).HasMaxLength(50);
|
|
builder.Property(x => x.LName).HasMaxLength(50);
|
|
builder.Property(x => x.IsActiveString).HasMaxLength(5);
|
|
builder.Property(x => x.HasUploadedImage).HasMaxLength(5);
|
|
builder.HasMany(x => x.EmployeesStatus)
|
|
.WithOne(x => x.RollCallEmployee)
|
|
.HasForeignKey(x => x.RollCallEmployeeId);
|
|
|
|
}
|
|
} |