Dynamic Queries and LINQ Expressions
Posted by: Rick Strahls WebLog,
on 14 Apr 2008 |
View original | Bookmarked: 0 time(s)
I'm revisiting some code in my LINQ to SQL business objects layer that I've written about before. The problem I ran into and described was that I had a class with generic business object behavior that needs to look up values based on a database field that wouldn't be known until runtime.
The concrete example I used is a Load(object x) method on the business object, where each instance of the class dynamically picks up the primary key (from the metadata available) and then loads an entity from the...