Running a Linq query against a Custom Column in the DAL

2 posts, 0 answers
  1. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 03 Mar 2010 Link to this post

    I've added a new property to one of my objects which returns a calculated value

    Running a simple query on the object through LinqPad works awesomely and I see the right value shown.  However if I try and write a LINQ Where clause against that column it throws an error telling me if it's a property, add the fieldalias attribute to it.

    **Edit** Note: The calculated Property only exists in my DAL, not in the DB

    What should I be doing here?
    Steve
  2. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 11 Mar 2010 Link to this post

    Hi Steve,

    This kind of query can not be processed on the database server as you do not have a column mapped to your property. That means you must execute it in memory by calling ToList() on the query before making the where clause.

    Regards,
    Zoran
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
Back to Top