I have an ASP.NET Core 6 Web API project and I am using AutoMapper. This is how I am configuring it in my Startup class:
services.AddAutoMapper(Assembly.GetExecutingAssembly());
Is there a way to configure AutoMapper to throw a custom exception when 2 types cannot be mapped? I have more than 10 mapping profiles in my project and I would like a certain error to be thrown when the types cannot be mapped.
I am using .NET 6.0