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 UserResume : CommonEntity, IEntityTypeBuilder { /// /// 用户Id /// public Guid UserId { get; set; } /// /// 用户 /// public User User { get; set; } /// /// 身份编号 /// public string PersonalIdentityCode { get; set; } /// /// 身份 /// public DictionaryData PersonalIdentity { get; set; } /// /// 学历编号 /// public string EducationalBackgroundCode { get; set; } /// /// 学历 /// public DictionaryData EducationalBackground { get; set; } /// /// 空闲时间 /// public EnumPersonalFreeTime? FreeTime { get; set; } /// /// 求职状态 /// public EnumPersonalJobSeekingStatus? JobSeekingStatus { get; set; } /// /// 工作资历 /// public string WorkSeniority { get; set; } /// /// 工作经验 /// public string WorkExperience { get; set; } /// /// 身高 /// public int? Height { get; set; } /// /// 体重 /// public int? Weight { 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) .OnDelete(DeleteBehavior.Restrict); entityBuilder .HasOne(it => it.EducationalBackground) .WithMany() .HasForeignKey(it => it.EducationalBackgroundCode) .HasPrincipalKey(it => it.Code) .OnDelete(DeleteBehavior.Restrict); } } }