Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » LINQ   (RSS)
Tip 40 – How to materialize presentation models via L2E
Problem: Imagine that you have these entities public class Product { public int ID { get; set; } public string Name { get; set; } public virtual Category Category { get; set; } } public class Category { public int ID { get; set; } public string Name { Read More...
Tip 35 – How to write OfTypeOnly<TEntity>()
If you write a LINQ to Entities query like this: var results = from c in ctx.Vehicles.OfType<Car>() select c; It will bring back, Cars and any type that derives from Car, like say SportCar or SUV. If you just want Cars and you don’t want derived Read More...
Some comments on efficient SOA method composition
A couple of posts back I started talking about composing SOAPY operations efficiently, by shipping intent to the service. An interesting debate ensued in my comments: Kristofer (the guy behind the Huagati tools for DBML and EDMX , and it seems a man after Read More...
Tip 8 - How to write 'WHERE IN' style queries using LINQ to Entities
Imagine if you have a table of People and you want to retrieve only those whose the Firstname is in a list of interesting firstnames. This is trivial in SQL, you write something like this: SELECT * FROM People WHERE Firstname IN ('Alex', 'Colin', 'Danny', Read More...
LINQ to Objects and Buffer<T>
I was debugging a problem a couple of days ago, when I learned something interesting. I had some code that looked like this: foreach(Employee e in manager.Manages) { … } The manager.Manages property returned a custom implementation of ICollection<Employee> Read More...
LINQ… the board game
About a week ago I was wandering through Crossroads mall in Bellevue, and with my wife’s new camera in hand, I spotted this: Now I’m sure at least one of you have actually played this, but I’d never even heard of it. If you know me, you know I’m vertically Read More...
Page view tracker