Replies: 2 comments 2 replies
-
https://github.com/AutoMapper/AutoMapper/blob/upgrade_guide/docs/Configuration.md#long-compilation-times |
Beta Was this translation helpful? Give feedback.
-
Also potentially a combination effect with EF core model compilation, which can also take quite a bit of time. Unless your mapping is extremely complex this might be a more likely culprit. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
i've create an ASP NET Core Web API with EF core, this have a lot of relationship within the tables
The automapper is configured with profile: CreateMap<ActivityBase, ActivityBaseModel>().ReverseMap().PreserveReferences();
In the startup register the Mapper register the DI is with services.AddAutoMapper(System.Reflection.Assembly.GetExecutingAssembly());
In the controller first execute the query and the result is mapped with this line of code:
return Mapper.Map(result); The query return one record.
The first time that i execute this line of code is very very slow 10 second, at the second attemp the execution is instant.
Anyone please have any suggestions?
Thanks in advance
RZ
Beta Was this translation helpful? Give feedback.
All reactions