dbelmont / ExpressionBuilder

A library that provides a simple way to create lambda expressions to filter lists and database queries.
Apache License 2.0
372 stars 105 forks source link

Build Expressions from Anonymous Types #38

Open whizkidwwe1217 opened 6 years ago

whizkidwwe1217 commented 6 years ago

There are instances where I need to make projections in Entity Framework. However, projections are anonymous types. For example: Context.Set<Person>().Select(e=> new { e.Id, e.Code, e.FirstName, e.LastName }).Where(<pass_expression_here>); Is it possible to build expressions when the source is an anonymous type?

dbelmont commented 6 years ago

Hi @whizkidwwe1217, Thanks for using the project. 😄 That's a very intriguing question. 🤔 I'll have a look and keep you posted on what I find. Cheers.