Example #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);
 }
Example #2
0
 private static Type GetRepositoryTypeByRegister(Type repositoryInterfaceType)
 {
     return(RepositoryRegistrar.GetRepositoryType(repositoryInterfaceType));
 }
Example #3
0
 private static TRepository GetRepositoryByRegister <TRepository>()
     where TRepository : class, IRepository
 {
     return(RepositoryRegistrar.GetRepository(typeof(TRepository)) as TRepository);
 }