c# - Multiple parameters in seed lambda expression -
i utilizing seed() method populate database. trying pre-populate 1 table data based on 2 keys, not one.
for example, doing elsewhere , working fine:
foreach (var drug in drugs) { context.drugs.addorupdate( d => d.orderid, drug ); }
is possible following?
foreach (var pd in patientdrugs) { context.patientdrugs.addorupdate( (p => p.dispensedate && p => p.drugid), pd ); }
did try this?
foreach (var pd in patientdrugs) { context.patientdrugs .addorupdate(p => new { p.dispensedate, p.drugid }, pd); }
Comments
Post a Comment