public IReadRepository <T> GetReadOnlyRepository <T>() where T : class { if (_repositories == null) { _repositories = new Dictionary <Type, object>(); } var type = typeof(T); if (!_repositories.ContainsKey(type)) { _repositories[type] = new RepositoryReadOnly <T>(Context); } return((IReadRepository <T>)_repositories[type]); }
public IRepositoryReadOnly <TEntity> GetReadOnlyRepository <TEntity>() where TEntity : BASE_ENTITY { if (_repositories == null) { _repositories = new Dictionary <Type, object>(); } var type = typeof(TEntity); if (!_repositories.ContainsKey(type)) { _repositories[type] = new RepositoryReadOnly <TEntity>(Context); } return((IRepositoryReadOnly <TEntity>)_repositories[type]); }