Replies: 2 comments 7 replies
-
You need an SQL profiler. |
Beta Was this translation helpful? Give feedback.
7 replies
-
This discussion has been automatically locked since there has not been any recent activity after it was closed. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have some mysterious blocking time apparently in the mapper's ProjectTo method which I can't reproduce locally (probably because of the load). It works fine but after a while (random) response time and thread count spike.
Web App is in .NET Framework 4.8 and Automapper version is 10.1.1
This is what I saw in the profiler:
Mapping in question is very simple:
items = context.Extras .Where(r => ...) .ProjectTo<ExtraDTO>(mapper.ConfigurationProvider, x => x.VehicleExtra) .ToList();
And mapping definition:
CreateMap<Extra, ExtraDTO>() .ForMember(dest => dest.VehicleRental, opt => opt.Ignore()) .ForMember(dest => dest.VehicleExtra, opt => opt.ExplicitExpansion());
What caught my eye is that this is called in a loop for the problematic requests, maybe around 100 times or so. I know that this should be refactored so I have one call, but this block never happened before and this was not changed.
Any ideas why this might be happening? We are using Automapper for a while and this never happened.
Beta Was this translation helpful? Give feedback.
All reactions