32 lines
969 B
C#
32 lines
969 B
C#
using Company.Domain.CrossJobAgg;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace CompanyManagment.EFCore.Mapping;
|
|
|
|
public class CrossJobMapping : IEntityTypeConfiguration<CrossJob>
|
|
{
|
|
public void Configure(EntityTypeBuilder<CrossJob> builder)
|
|
{
|
|
builder.ToTable("CrossJobs");
|
|
builder.HasKey(x => x.id);
|
|
|
|
//builder.Property(x => x.Title).HasMaxLength(255).IsRequired();
|
|
builder.Property(x => x.SalaryRatioOver).IsRequired();
|
|
builder.Property(x => x.SalaryRatioUnder).IsRequired();
|
|
builder.Property(x => x.EquivalentRialOver).IsRequired();
|
|
builder.Property(x => x.EquivalentRialUnder).IsRequired();
|
|
|
|
|
|
|
|
builder.HasOne(x => x.CrossJobGuild)
|
|
.WithMany(x => x.CrossJobList)
|
|
.HasForeignKey(x => x.CrossJobGuildId);
|
|
|
|
//builder.HasOne(x => x.Job).WithMany(x => x.CrossJobList).HasForeignKey(x => x.JobId);
|
|
|
|
|
|
}
|
|
|
|
|
|
} |