我有如下方法:
public static IList<MedicalRecord> UpdateServicePrice(
IList<MedicalRecord> mListMedicalRecord,
IList<ServicePrice> listAllServicePrice)
{
foreach (MedicalRecord medical in mListMedicalRecord)
{
medical.mListServicePrice =
(from p in listAllServicePrice
where p.MedicalRecordID == medical.MedicalRecordID
select p).ToList();
}
return mListMedicalRecord;
}
但它运行得很慢。任何人都可以帮助我提高上述方法的性能?非常感谢。