using Furion.DatabaseAccessor; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FlexJobApi.Core { /// /// 用户信息期望岗位 /// public class UserInfoExpectJob : CommonEntity, IEntityTypeBuilder { /// /// 用户信息Id /// public Guid UserInfoId { get; set; } /// /// 用户信息 /// public UserInfo UserInfo { get; set; } /// /// 期望岗位编号 /// public string PersonalIdentityCode { get; set; } /// /// 期望岗位 /// public DictionaryData PersonalIdentity { get; set; } public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator) { entityBuilder .HasOne(it => it.PersonalIdentity) .WithMany() .HasForeignKey(it => it.PersonalIdentityCode) .HasPrincipalKey(it => it.Code) .IsRequired() .OnDelete(DeleteBehavior.Restrict); } } }