Open philippjenni opened 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))
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 });
query.Project<from, to>(new { languageId = 1 });
I use this for Language Fallbacks in MultiLanguage Applications
Dear @philippjenni,
Thanks a lot for for your valuable input! It's added to the backlog.
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