有这些课程:
public interface IDbContextFactory
{
DbContext GetContext();
}
public class Repo<T> : IRepo<T> where T : Entity, new()
{
protected readonly DbContext c;
}
public Repo(IDbContextFactory f)
{
c = f.GetContext();
}
关键字new()
(in class Repo<T>
) 有什么作用?