ASP.NET-MVC-Template error
Здравейте,
Използвам на Ники темплейта (https://github.com/NikolayIT/ASP.NET-MVC-Template) и при създаване на нов Service с AutoMapper в него:
=>В MovieCatalogAspNetCore.Services.Data ->
public class MoviesService : IMoviesService
{
private readonly IMapper mapper;
public MoviesService(ApplicationDbContext context, IMapper mapper)
{
this.mapper = mapper;
}
}
=> В Startup.cs: services.AddTransient<IMoviesService, MoviesService>();
Получавам следната грешка:
System.AggregateException
HResult=0x80131500
Message=Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: MovieCatalogAspNetCore.Services.Data.Contracts.IMoviesService Lifetime: Transient ImplementationType: MovieCatalogAspNetCore.Services.Data.MoviesService': Unable to resolve service for type 'AutoMapper.IMapper' while attempting to activate 'MovieCatalogAspNetCore.Services.Data.MoviesService'.)
Source=Microsoft.Extensions.DependencyInjection
StackTrace:
at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(IEnumerable`1 serviceDescriptors, ServiceProviderOptions options)
........................ и т.н.
Някой сблъсквал ли се е с подобна грешка?
Благодаря :)