Я создаю. NET Core API, затем я решаю создать репозиторий, поэтому создайте DataAccessLayer с интерфейсами и реализациями
public class GappedData : IGappedData
{
private readonly GappedContext context;
private readonly IDictionary<Type, object> repositories;
public GappedData(GappedContext context)
{
this.context = context;
this.repositories = new Dictionary<Type, object>();
}
public IRepository<ApplicationUser> ApplicationUser => this.GetRepository<ApplicationUser>();
private IRepository<T> GetRepository<T>() where T : class
{
var type = typeof(T);
if (!this.repositories.ContainsKey(type))
{
var typeOfRepository = typeof(IRepository<T>);
var repository = Activator.CreateInstance(typeOfRepository, this.context);
this.repositories.Add(type, repository);
}
return (IRepository<T>)this.repositories[type];
}
}
, поэтому при попытке вызвать его выдается исключение
Конструктор типа «Gapped.DataAccessLayer.Interfaces.IRepository`1 [[Gapped.Entities.Models.ApplicationUser.ApplicationUser, Gapped.Entities, Version = 1.0.0.0, Culture = нейтральный, PublicKeyToken = null]]» не найден.