I am working on a generic repository pattern on EF Core and I have a problem resolving the dependency of my Repository on Asp.Net Core. Using Unity i am Able to Solve the dependency here are my code:
Using Unity
//here is the Line I Cant Resolve
.RegisterType<IRepositoryAsync<Movie>, Repository<Movie>>()
.RegisterType<IMovieService, MovieService>()
Asp.Net Core
services.AddScoped<IRepositoryAsync<Movie>, Repository<Movie>>();
services.AddTransient<IMovieService, MovieService>();
and I am getting Error
InvalidOperationException: Unable to resolve service for type 'Repository.Pattern.DataContext.IDataContextAsync' while attempting to activate 'Repository.Pattern.Core.Repository`1[Sample.Models.Movie]'.
Can anyone has a clear documentation on how Native Dependency Injection works on Asp.Net Core
IDataContextAsync?