This is a migrated thread and some comments may be shown as answers.

Running a Linq query against a Custom Column in the DAL

1 Answer 58 Views
LINQ (LINQ specific questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 03 Mar 2010, 07:40 PM
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

1 Answer, 1 is accepted

Sort by
0
Zoran
Telerik team
answered on 11 Mar 2010, 06:55 PM
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.
Tags
LINQ (LINQ specific questions)
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Zoran
Telerik team
Share this question
or