LINQ - Using LINQ with an anonymous type - Asked By Justin P on 27-Jul-11 01:05 PM

I am moving a project from working with standard DB queries to working with EF and LINQ. I have a table that has certain records that I would use to build a query that would look like the following:

"select * from client where city = ..." In my original table, I would be pulling client and city from the table to build that query.

It is also possible that client and city above could be another table and/or field altogether. How would I do the same thing with EF and LINQ? Is this even possible or do I have to build a separate class to handle all of that logic?

"from c in context.clients
 where c.city == ....
 select c"
Riley K replied to Justin P on 27-Jul-11 10:10 PM
In don't think you have to create a separate class,

By default when you create a Entity Data Model a entity class is generated with the fields
as properties


and you can go with the following query as you mentioned

from c in context.clients
 where c.city == ....
 select c"

Hope this helps you 
Asked By Justin P on 29-Jul-11 07:39 AM
No, I'm asking about not knowing what "client" or "city" will be until run time based on choices made by the user.