Error: No parameterless constructor for AutoMapperConfigurationAutoMapper Dependency Injection mit Parametern
ich das nuget Paket bin mit automapper DI
public class AutoMapperConfiguration : Profile
{
private readonly ICloudStorage _cloudStorage;
public AutoMapperConfiguration(ICloudStorage cloudStorage)
{
_cloudStorage = cloudStorage;
// Do mapping here
}
}
public void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<ICloudStorage, AzureStorage>();
services.AddAutoMapper(); // Errors here
}
Wie kann ich die AutoMapper DI mit Parametern verwenden?
[diese] (https://stackoverflow.com/a/40275196/6583901) hilft – NtFreX
@ Dr.Fre keine Parameter erlauben in AutoMapper Konstruktor –
@MartinDawson richtig ist. Sie können nur in benutzerdefinierte Resolver und Konverter injizieren. – efredin