Ejemplo n.º 1
0
        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]);
        }
Ejemplo n.º 2
0
        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]);
        }