Reputation: 539
Is there any way to customize it?
This is what Im trying to do:
string customSelect = "c.person_name";
int per = PersonID();
var RetrievItem = (from c in db.person where c.person_id == per select new { customSelect }).FirstOrDefault();
I've tried to debugging it but it just ended up retrieving given string instead of value from database
Any suggestions @_ @?
Upvotes: 0
Views: 467
Reputation: 486
In addition to Hamlet's comment about an expression based solution, you can have a look at the Dynamic Linq library. It supports lamba expressions defined as strings, which is exactly what you need.
Upvotes: 3