Browse by Tags

All Tags » LINQ (RSS)

LINQ-SQL: Why I Love it and why I hate it by joelvarty

Love it: Generate a class structure based on database tables. Makes coding transactions really easy and seamless. Makes working with store procedures more like methods. Makes it easier to validate database field names at compile-time.   Hate it:...
Filed under: , ,

LINQ-SQL – Incorrect results from Count() from Lambda expressions by joelvarty

Check out the following C# code:   using (MyDataContext db = new MyDataContext()) { int count1 = db.MyTable.Count(t=> t.IsActive == true ); int count2 = db.MyTable.Select(t => t.IsActive == true ).Count(); }   Judging by you what you see...
Filed under: ,
More Posts