Version 4.2.1.0 : Problem with ProjectTo
See original GitHub issueI am using AutoMapper 4.2.1.0 to map an entity type into a DTO using ProjectTo .
I have created my Map like this :
var config = new MapperConfiguration(cfg =>
{
cfg.CreateMap<Order, OrderDTO>();
cfg.CreateMap<Order_Detail, Order_DetailDTO>();
});
and I am using config object like this :
var builder = config.ExpressionBuilder;
return ((IQueryable<Order>) property.GetValue(_db, null)).ProjectTo<OrderDTO>(builder);
but I am getting an error that says :
Missing map from Order to OrderDTO. Create using Mapper.CreateMap<Order, OrderDTO>.
Is there something that I do wrong ?
Here is the same question that I asked on SO: http://stackoverflow.com/questions/36450885/automapper-doesnt-work-as-it-should
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Automapper ProjectTo<>() issue when using NotMapped ...
I am getting the error only when I am using ProjectTo, I could not understand the underlying issue. (Automapper version am using 4.2.1.0) ......
Read more >Troubleshoot .NET Framework targeting errors
To resolve the error, make sure that your application targets a .NET version that's compatible with the version that's targeted by the projects ......
Read more >Code Generation Fail: An all the king's horses tragedy
Runtime, Version=4.2.1.0) when reflecting in T4 template in .NET Core 2.1 app. As always, I hope this has helped someone with a similar ......
Read more >How to resolve .NET reference and NuGet package version ...
So now the problem arises for a single application. What to do when several of its projects depend on different version of the...
Read more >PathSeqBuildReferenceTaxonomy – GATK
Build an annotated taxonomy datafile for a given microbe reference. The output file from this tool is required to run the PathSeq pipeline....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
var ((IQueryable<TEntity>) property.GetValue(_db, null)).ProjectTo<TDto>(config);
should workI was misled by this article : https://lostechies.com/jimmybogard/2016/01/21/removing-the-static-api-from-automapper/