Multiple parameters in mvc4 seed lamdba expression
I am utilizing the Seed() method to populate my database. I am trying to
pre-populate one table with data based on two keys, not just one.
For example, I am doing this elsewhere and it is working fine:
foreach (var drug in Drugs)
{
context.Drugs.AddOrUpdate(
d => d.OrderId,
drug
);
}
Is it possible to do something like the following?
foreach (var pd in PatientDrugs)
{
context.PatientDrugs.AddOrUpdate(
(p => p.DispenseDate && p => p.DrugId),
pd
);
}
No comments:
Post a Comment