示例#1
0
 /// <summary>
 /// 注册单例仓储,请确保<paramref name="repository"/>是线程访问安全的
 /// </summary>
 /// <typeparam name="TRepository"></typeparam>
 /// <typeparam name="TObject"></typeparam>
 /// <param name="repository"></param>
 public static void Register <TRepository>(IRepository repository)
     where TRepository : IRepository
 {
     RepositoryRegistrar.Register <TRepository>(repository);
 }
示例#2
0
 private static Type GetRepositoryTypeByRegister(Type repositoryInterfaceType)
 {
     return(RepositoryRegistrar.GetRepositoryType(repositoryInterfaceType));
 }
示例#3
0
 private static TRepository GetRepositoryByRegister <TRepository>()
     where TRepository : class, IRepository
 {
     return(RepositoryRegistrar.GetRepository(typeof(TRepository)) as TRepository);
 }