I’m writing a linq query and I’m wondering if I’m doing it right: I’m passing in 2 parameters, TheDate and UserID
Var Output = from c in in MyDC.Table1
where c.Datetime.Date == TheDate.Date
where c.UserID == TheUserID
select new MyMode()
{
Var1 = (from c1 in MyDC.Table1
where c.ID == c1.ID
select c1.ID).Count()
Var2 = ...
}
I’m thinking I should be able to do the count for Var1 without going back to the original MyDC but for now that’s what I have.
Let me know if there’s a better way to do it.
Thanks.
1 Answer