优化导航属性
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
36c354c8f0
commit
21ded0d466
|
@ -4745,11 +4745,6 @@
|
|||
文件路径
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataTrialSetView.CreateTime">
|
||||
<summary>
|
||||
创建时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.ClinicalDataTrialSetView.CreateUserId">
|
||||
<summary>
|
||||
创建人
|
||||
|
|
|
@ -221,7 +221,6 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
|
||||
public class AnalysisTaskView : ReadingTaskView
|
||||
{
|
||||
public bool? IsSelfAnalysis { get; set; }
|
||||
|
||||
public int ConsistentClinicalDataCount { get; set; } = 0;
|
||||
|
||||
|
|
|
@ -821,7 +821,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
.WhereIf(inQuery.SubjectVisitId != null, t => t.SubjectId == inQuery.SubjectVisitId)
|
||||
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||
.WhereIf(inQuery.IsDicom != null, t => t.IsDicom == inQuery.IsDicom)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Uploader), t => t.Uploader.UserName.Contains(inQuery.Uploader))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Uploader), t => t.CreateUser.UserName.Contains(inQuery.Uploader))
|
||||
.WhereIf(inQuery.IsSuccess != null, t => t.IsSuccess == inQuery.IsSuccess)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.StudyCode), t => t.StudyCode.Contains(inQuery.StudyCode))
|
||||
.Select(t => new UnionStudyMonitorExportDto()
|
||||
|
@ -838,7 +838,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
IsDicom = t.IsDicom,
|
||||
|
||||
Uploader = t.Uploader.UserName,
|
||||
Uploader = t.CreateUser.UserName,
|
||||
|
||||
IP = t.IP,
|
||||
|
||||
|
|
|
@ -771,10 +771,10 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
}
|
||||
|
||||
var query = _visitTaskRepository.Where(t => t.SubjectId == inQuery.SubjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId
|
||||
&& t.SourceSubjectVisitId != null && t.DoctorUserId == doctorUserId && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == isAnalysisCreate)
|
||||
&& t.SourceSubjectVisitId != null && t.DoctorUserId == doctorUserId && t.TaskState == TaskState.Effect)
|
||||
.ProjectTo<SubjectCRCImageUploadedDto>(_mapper.ConfigurationProvider);
|
||||
|
||||
|
||||
//这里过滤是否是一致性分析的
|
||||
var list = await query.Where(t => t.SubjectCode == inQuery.SubjectCode).ToListAsync();
|
||||
|
||||
foreach (var item in list)
|
||||
|
|
|
@ -411,7 +411,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
|
||||
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
||||
|
||||
Uploader = t.Uploader.UserName,
|
||||
Uploader = t.CreateUser.UserName,
|
||||
|
||||
UploadTime = t.CreateTime
|
||||
|
||||
|
@ -493,7 +493,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
.WhereIf(inQuery.SubjectVisitId != null, t => t.SubjectId == inQuery.SubjectVisitId)
|
||||
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||
.WhereIf(inQuery.IsDicom != null, t => t.IsDicom == inQuery.IsDicom)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Uploader), t => t.Uploader.UserName.Contains(inQuery.Uploader))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Uploader), t => t.CreateUser.UserName.Contains(inQuery.Uploader))
|
||||
.WhereIf(inQuery.IsSuccess != null, t => t.IsSuccess == inQuery.IsSuccess)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.StudyCode), t => t.StudyCode.Contains(inQuery.StudyCode))
|
||||
.Select(t => new UnionStudyMonitorModel()
|
||||
|
@ -514,7 +514,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
|
||||
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
||||
|
||||
Uploader = t.Uploader.UserName,
|
||||
Uploader = t.CreateUser.UserName,
|
||||
|
||||
UploadTime = t.CreateTime,
|
||||
|
||||
|
|
|
@ -43,8 +43,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
CreateMap<DicomStudy, StudyDTO>().IncludeMembers(t => t.Subject, u => u.SubjectVisit)
|
||||
.ForMember(d => d.SiteName, u => u.MapFrom(s => s.Subject.TrialSite.TrialSiteName))
|
||||
.ForMember(d => d.UploaderFirstName, u => u.MapFrom(s => s.Uploader.FirstName))
|
||||
.ForMember(d => d.UploaderLastName, u => u.MapFrom(s => s.Uploader.LastName))
|
||||
.ForMember(d => d.UploaderFirstName, u => u.MapFrom(s => s.CreateUser.FirstName))
|
||||
.ForMember(d => d.UploaderLastName, u => u.MapFrom(s => s.CreateUser.LastName))
|
||||
.ForMember(d => d.UploadedTime, u => u.MapFrom(s => s.CreateTime));
|
||||
|
||||
CreateMap<Subject, StudyDTO>();
|
||||
|
@ -69,7 +69,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
CreateMap<DicomStudy, QAStudyInfoDTO>()
|
||||
.ForMember(o => o.IsCompleteClinicalData, t => t.MapFrom(u => !u.ReadingClinicalDataList.Any(x => x.ReadingClinicalDataPDFList.Count() == 0)))
|
||||
.ForMember(o => o.UploadedTime, t => t.MapFrom(u => u.CreateTime))
|
||||
.ForMember(o => o.Uploader, t => t.MapFrom(u => u.Uploader.LastName + " / " + u.Uploader.FirstName))
|
||||
.ForMember(o => o.Uploader, t => t.MapFrom(u => u.CreateUser.LastName + " / " + u.CreateUser.FirstName))
|
||||
.ForMember(o => o.StudyId, t => t.MapFrom(u => u.Id))
|
||||
.ForMember(o => o.IsHaveUploadFailed, t => t.MapFrom(u => u.DicomStudyMonitorList.Any(t => t.FailedFileCount > 0)))
|
||||
.ForMember(o => o.Modalities, t => t.MapFrom(u => string.Join('、', u.SeriesList.Select(t => t.Modality).Distinct())));
|
||||
|
|
|
@ -536,7 +536,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
// 一致性核查文件
|
||||
CreateMap<InspectionFile, GetUserUploadFileDto>()
|
||||
.ForMember(d => d.CreateUserName, u => u.MapFrom(t => t.User.FirstName + "/" + t.User.LastName));
|
||||
.ForMember(d => d.CreateUserName, u => u.MapFrom(t => t.CreateUser.FullName));
|
||||
|
||||
|
||||
//CRC 质疑列表
|
||||
|
|
|
@ -161,11 +161,6 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
public List<string> TrialCriterionNameList { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
|
|
|
@ -337,7 +337,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
CreateMap<DicomStudy, SelectStudyView>()
|
||||
.ForMember(o => o.UploadedTime, t => t.MapFrom(u => u.CreateTime))
|
||||
.ForMember(o => o.Uploader, t => t.MapFrom(u => u.Uploader.LastName + " / " + u.Uploader.FirstName))
|
||||
.ForMember(o => o.Uploader, t => t.MapFrom(u => u.CreateUser.LastName + " / " + u.CreateUser.FirstName))
|
||||
.ForMember(o => o.StudyId, t => t.MapFrom(u => u.Id));
|
||||
|
||||
CreateMap<VisitTask, HaveGeneratedTaskDto>()
|
||||
|
|
|
@ -132,7 +132,7 @@ namespace IRaCIS.Core.Application.Service.Third_partyProject
|
|||
|
||||
TrialSiteCode = dicomStudy.Subject.TrialSite.TrialSiteCode,
|
||||
|
||||
Uploader = dicomStudy.Uploader.UserName,
|
||||
Uploader = dicomStudy.CreateUser.UserName,
|
||||
|
||||
UploadTime = dicomStudy.CreateTime
|
||||
};
|
||||
|
|
|
@ -191,8 +191,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
CreateMap<SignDTO, TrialSign>();
|
||||
|
||||
CreateMap<TrialStateChange, TrialStateChangeDTO>()
|
||||
.ForMember(t => t.UserRealName, u => u.MapFrom(c => c.User.FullName))
|
||||
.ForMember(t => t.UserName, u => u.MapFrom(c => c.User.UserName));
|
||||
.ForMember(t => t.UserRealName, u => u.MapFrom(c => c.CreateUser.FullName))
|
||||
.ForMember(t => t.UserName, u => u.MapFrom(c => c.CreateUser.UserName));
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -159,10 +159,10 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
ConfirmUserId = confirm.ConfirmUserId,
|
||||
ConfirmTime = confirm.ConfirmTime,
|
||||
RealName = confirm.User.FullName,
|
||||
UserName = confirm.User.UserName,
|
||||
UserTypeId = confirm.User.UserTypeId,
|
||||
UserTypeShortName = confirm.User.UserTypeRole.UserTypeShortName,
|
||||
RealName = confirm.ConfirmUser.FullName,
|
||||
UserName = confirm.ConfirmUser.UserName,
|
||||
UserTypeId = confirm.ConfirmUser.UserTypeId,
|
||||
UserTypeShortName = confirm.ConfirmUser.UserTypeRole.UserTypeShortName,
|
||||
|
||||
FullFilePath = sysDoc.Path
|
||||
};
|
||||
|
|
|
@ -31,10 +31,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[JsonIgnore]
|
||||
public User RequestReReadingConfirmUser { get; set; }
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
public User CreateUser { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public Trial Trial { get; set; }
|
||||
|
||||
|
|
|
@ -68,6 +68,10 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
public Guid CreateUserId { get; set; }
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
[ForeignKey("CreateUserId")]
|
||||
[JsonIgnore]
|
||||
public User CreateUser { get; set; }
|
||||
}
|
||||
|
||||
public abstract class BaseAddDeleteAuditEntity : Entity, IAuditAdd, ISoftDelete
|
||||
|
@ -78,6 +82,10 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public Guid? DeleteUserId { get; set; }
|
||||
public bool IsDeleted { get; set; }
|
||||
public DateTime? DeletedTime { get; set; }
|
||||
|
||||
[ForeignKey("CreateUserId")]
|
||||
[JsonIgnore]
|
||||
public User CreateUser { get; set; }
|
||||
}
|
||||
|
||||
public abstract class BaseFullAuditEntity : Entity, IAuditUpdate, IAuditAdd
|
||||
|
@ -87,9 +95,9 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public Guid UpdateUserId { get; set; }
|
||||
public DateTime UpdateTime { get; set; }
|
||||
|
||||
//[ForeignKey("CreateUserId")]
|
||||
//[JsonIgnore]
|
||||
//public User CreateUser { get; set; }
|
||||
[ForeignKey("CreateUserId")]
|
||||
[JsonIgnore]
|
||||
public User CreateUser { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
@ -102,6 +110,10 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public DateTime CreateTime { get; set; }
|
||||
public Guid UpdateUserId { get; set; }
|
||||
public DateTime UpdateTime { get; set; }
|
||||
|
||||
[ForeignKey("CreateUserId")]
|
||||
[JsonIgnore]
|
||||
public User CreateUser { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
@ -112,6 +124,8 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
public Guid CreateUserId { get; set; }
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
public abstract class BaseAuditUpdateEntity : Entity, IAuditUpdate
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("ConfirmUserId")]
|
||||
public User User { get; set; }
|
||||
public User ConfirmUser { get; set; }
|
||||
#endregion
|
||||
|
||||
|
||||
|
|
|
@ -24,11 +24,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[ForeignKey("SubjectVisitId")]
|
||||
public SubjectVisit SubjectVisit { get; set; }
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("CreateUserId")]
|
||||
public User Uploader { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public List<ReadingClinicalData> ReadingClinicalDataList { get; set; }
|
||||
|
||||
|
|
|
@ -37,9 +37,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[JsonIgnore]
|
||||
[ForeignKey("TrialId")]
|
||||
public Trial Trial { get; set; }
|
||||
[JsonIgnore]
|
||||
[ForeignKey("CreateUserId")]
|
||||
public User Uploader { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -27,11 +27,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[JsonIgnore]
|
||||
public Subject Subject { get; set; }
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("CreateUserId")]
|
||||
public User CreateUser { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
|
|
@ -26,11 +26,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public Subject Subject { get; set; }
|
||||
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("CreateUserId")]
|
||||
public User Uploader { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
public Guid SeqId { get; set; }
|
||||
|
|
|
@ -15,8 +15,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[JsonIgnore]
|
||||
public Trial Trial { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public User CreateUser { get; set; }
|
||||
#endregion
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
|
|
|
@ -24,8 +24,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[JsonIgnore]
|
||||
public List<SystemNoticeUserRead> NoticeUserReadList { get; set; } = new List<SystemNoticeUserRead>();
|
||||
|
||||
[JsonIgnore]
|
||||
public User CreateUser { get; set; }
|
||||
#endregion
|
||||
|
||||
|
||||
|
|
|
@ -23,9 +23,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[JsonIgnore]
|
||||
public List<VisitTask> VisitTaskList { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("DoctorId")]
|
||||
public Doctor Doctor { get; set; }
|
||||
#endregion
|
||||
|
||||
|
||||
|
|
|
@ -25,11 +25,9 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public SubjectVisit SubjectVisit { get; set; }
|
||||
[JsonIgnore]
|
||||
public TrialSite TrialSite { get; set; }
|
||||
[JsonIgnore]
|
||||
public User CreateUser { get; set; }
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
|
||||
public VisitTask VisitTask { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
|
|
|
@ -18,8 +18,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
public Guid SubjectVisitId { get; set; }
|
||||
|
||||
public User CreateUser { get; set; }
|
||||
|
||||
|
||||
public UserTypeEnum UserTypeEnum { get; set; }
|
||||
|
||||
|
|
|
@ -11,9 +11,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public class InspectionFile : BaseAddAuditEntity
|
||||
{
|
||||
#region 导航属性
|
||||
[JsonIgnore]
|
||||
[ForeignKey("CreateUserId")]
|
||||
public User User { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
public string FileName { get; set; } = string.Empty;
|
||||
|
|
|
@ -9,9 +9,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
{
|
||||
#region 导航属性
|
||||
[JsonIgnore]
|
||||
[ForeignKey("CreateUserId")]
|
||||
public User CreateUser { get; set; }
|
||||
[JsonIgnore]
|
||||
[ForeignKey("LatestReplyUserId")]
|
||||
public User LatestReplyUser { get; set; }
|
||||
[JsonIgnore]
|
||||
|
|
|
@ -9,9 +9,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
#region 导航属性
|
||||
[JsonIgnore]
|
||||
public QCChallenge QCChallenge { get; set; }
|
||||
[JsonIgnore]
|
||||
[ForeignKey("CreateUserId")]
|
||||
public User CreateUser { get; set; }
|
||||
#endregion
|
||||
|
||||
public string TalkContent { get; set; } = string.Empty;
|
||||
|
|
|
@ -47,9 +47,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
}
|
||||
}
|
||||
[JsonIgnore]
|
||||
[ForeignKey("CreateUserId")]
|
||||
public User CreateUser { get; set; }
|
||||
|
||||
#endregion
|
||||
/// <summary>
|
||||
|
|
|
@ -11,9 +11,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[JsonIgnore]
|
||||
public virtual TrialStatusDetail TrialDetail { get; set; }
|
||||
[JsonIgnore]
|
||||
[ForeignKey("CreateUserId")]
|
||||
public User CreateUser { get; set; }
|
||||
[JsonIgnore]
|
||||
public Doctor Doctor { get; set; }
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -18,10 +18,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[ForeignKey("TrialId")]
|
||||
public Trial Trial { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("CreateUserId")]
|
||||
public User User { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
|
|
|
@ -14,10 +14,12 @@ namespace IRaCIS.Core.Domain.Models
|
|||
#region 导航属性
|
||||
[JsonIgnore]
|
||||
public Trial Trial { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("UserId")]
|
||||
public User User { get; set; }
|
||||
#endregion
|
||||
|
||||
public Guid UserId { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
|
|
|
@ -17,10 +17,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
{
|
||||
#region 导航属性
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("CreateUserId")]
|
||||
public User CreateUser { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public List<VisitPlanInfluenceStudy> InfluenceStudyList { get; set; } = new List<VisitPlanInfluenceStudy>();
|
||||
|
||||
|
|
|
@ -15,9 +15,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
{
|
||||
#region 导航属性
|
||||
[JsonIgnore]
|
||||
[ForeignKey("CreateUserId")]
|
||||
public User CreateUser { get; set; }
|
||||
[JsonIgnore]
|
||||
[ForeignKey("VisitPlanInfluenceStatId")]
|
||||
public VisitPlanInfluenceStat VisitPlanInfluenceStat { get; set; }
|
||||
[JsonIgnore]
|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
using IRaCIS.Core.Domain.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using System.Reflection.Emit;
|
||||
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
||||
{
|
||||
public class SubjectConfigration : IEntityTypeConfiguration<Subject>
|
||||
{
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Subject> builder)
|
||||
{
|
||||
//不能同时配置一对多 和一对一 但是有时表要存储多的最新的 比如受试者 最新的访视 在这里要显示配置
|
||||
builder.HasOne(s => s.LatestSubjectVisit).WithMany().HasForeignKey(t => t.LatestSubjectVisitId);
|
||||
builder.HasOne(s => s.LatestSubjectVisit).WithMany().HasForeignKey(t => t.LatestSubjectVisitId);
|
||||
builder.HasOne(s => s.FinalSubjectVisit).WithMany().HasForeignKey(t => t.FinalSubjectVisitId);
|
||||
builder.HasMany(s => s.SubjectVisitList).WithOne(sv => sv.Subject).HasForeignKey(t => t.SubjectId);
|
||||
}
|
||||
|
@ -48,9 +49,39 @@ namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
|||
{
|
||||
public void Configure(EntityTypeBuilder<User> builder)
|
||||
{
|
||||
//User 和VisitTask 存在一对多的关系 这里不显式配置就报错,why?
|
||||
builder.HasMany(t => t.VisitTaskList).WithOne(t => t.DoctorUser).HasForeignKey(t => t.DoctorUserId);
|
||||
|
||||
//builder.HasOne(t => t.Doctor).WithOne(t => t.User);
|
||||
}
|
||||
}
|
||||
|
||||
public class SystemDocConfirmedUserConfigration : IEntityTypeConfiguration<SystemDocConfirmedUser>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<SystemDocConfirmedUser> builder)
|
||||
{
|
||||
//// 配置 CreateUser 关系
|
||||
//builder.HasOne(s => s.CreateUser)
|
||||
// .WithMany() // 假设 User 表没有对应的反向导航属性,如果有,填入属性名
|
||||
// .HasForeignKey(s => s.CreateUserId);
|
||||
////.OnDelete(DeleteBehavior.Restrict); // 可根据业务需求调整删除行为
|
||||
|
||||
// 配置 ConfirmUser 关系
|
||||
builder.HasOne(s => s.ConfirmUser) // ConfirmUser
|
||||
.WithMany(t => t.SystemDocConfirmedList)
|
||||
.HasForeignKey(s => s.ConfirmUserId);
|
||||
//.OnDelete(DeleteBehavior.Restrict);
|
||||
}
|
||||
}
|
||||
|
||||
public class TrialUserConfigration : IEntityTypeConfiguration<TrialUser>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<TrialUser> builder)
|
||||
{
|
||||
builder.HasOne(s => s.User)
|
||||
.WithMany(t => t.UserTrials)
|
||||
.HasForeignKey(s => s.UserId);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue