我遇到了一个奇怪的问题。如图所示,实际上我选择了记录号 37,但 lightswitch 突出显示为记录号 1。 1) FristName, LastName & HospitalName 是 Doctors 表中的唯一索引,因为每个医生可以有多个地址。
2) 我正在如下验证此下拉字段,以避免用户选择不属于患者所属医院的医生。
partial void DoctorsMasterItem_Validate(EntityValidationResultsBuilder results)
{
if (this.DoctorsMasterItem != null)
{
if (this.HospitalName != this.DoctorsMasterItem.HospitalName)
{
results.AddPropertyError("Make Sure the Hospital Patient belongs to and Doctor is also part of that hospital else your letters address would be wrong");
}
}
}
数据模型是
最佳答案
关于c# - 使用 LINQ 比较两个字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9796359/