EF 코어의 일반 저장소 패턴에서 작업 중이며 Asp.Net 코어에 대한 리포지토리의 종속성을 해결하는 데 문제가 있습니다. 내가 여기에 의존성을 해결 할 수 있어요 사용 유니티 내 코드입니다 :Asp.Net 코어의 종속성 해결
유니티를 사용
//here is the Line I Cant Resolve
.RegisterType<IRepositoryAsync<Movie>, Repository<Movie>>()
.RegisterType<IMovieService, MovieService>()
Asp.Net 코어
services.AddScoped<IRepositoryAsync<Movie>, Repository<Movie>>();
services.AddTransient<IMovieService, MovieService>();
내가 오류
무엇입니까InvalidOperationException: Unable to resolve service for type 'Repository.Pattern.DataContext.IDataContextAsync' while attempting to activate 'Repository.Pattern.Core.Repository`1[Sample.Models.Movie]'.
Can anyon e는 Native Dependency Injection이 Asp.Net Core에서 작동하는 방법에 대한 명확한 문서를 가지고 있습니다.
글쎄'IDataContextAsync' 무엇인가 여기에있다? – DavidG
당신은 내게 단서 친구를주었습니다! :) –
글쎄 예외가 메시지에 있었는데, 나는 사람들이 그들을 무시하는 이유를 이해 못할거야! – DavidG