vb.net - C# equivalent of VB LINQ Query -
i have following query in vb, not know how translate c# synatax
dim q = c in db.customers group join o in db.orders on c.customerid equals o.customerid orders = group select new {c.contactname, .ordercount = orders.count()}
thank you
it's pretty easy. have drop "group":
var q = c in db.customers join o in db.orders on c.customerid equals o.customerid orders select new { c.contactname, ordercount = orders.count() };
or, if you're looking lambda syntax:
var q = db.customers.groupjoin(db.orders, o => o.customerid, c => c.customerid, (c, orders) => new { c.contactname, ordercount = orders.count() });
Comments
Post a Comment