fluentsprings / ExpressMapper

Mapping .Net types
http://www.expressmapper.org
Other
310 stars 65 forks source link

Support parameters in Project<>() #88

Open philippjenni opened 8 years ago

philippjenni commented 8 years ago

It would be nice i can paste parameters to the Project<>() Methode like in AutoMapper (https://github.com/AutoMapper/AutoMapper/wiki/Queryable-Extensions#parameterization

Mapping int languageId = 0; .ForMember(dto => dto.Description, expr => expr.MapFrom(data => data.Language.FirstOrDefault(itm => itm.SpracheId == languageId).Name ?? data.Language.FirstOrDefault().Name))

Projection query.Project<from, to>(new { languageId = 1 });

I use this for Language Fallbacks in MultiLanguage Applications

anisimovyuriy commented 8 years ago

Dear @philippjenni,

Thanks a lot for for your valuable input! It's added to the backlog.