protected CrudWithValidationServiceBase(IProvideItemById <TEntity, TId> entityProvider      = null, IProvideItemByIdWithIncludes <TEntity, TId> entityWithIncludesProvider = null,
                                         ICreateEntityWithValidation <TEntity> entityCreator = null, IUpdateEntityWithValidation <TEntity> entityUpdater = null, IDeleteEntityWithValidation <TEntity, TId> entityDestroyer = null)
 {
     _validationErrors           = new Dictionary <string, string>();
     _entityProvider             = entityProvider;
     _entityWithIncludesProvider = entityWithIncludesProvider;
     _entityCreator   = entityCreator;
     _entityUpdater   = entityUpdater;
     _entityDestroyer = entityDestroyer;
 }
Exemplo n.º 2
0
        protected RepositoryBase(IProvideItemById <TEntity, TId> entityByIdProvider, IProvideItemByIdWithIncludes <TEntity, TId> entityWithIncludesByIdProvider,
                                 ICreateEntity <TEntity> entityCreator, IUpdateEntity <TEntity> entityUpdater, IDeleteEntity <TEntity, TId> entityDestroyer)
        {
            if (entityByIdProvider == null || entityWithIncludesByIdProvider == null || entityCreator == null ||
                entityUpdater == null || entityDestroyer == null)
            {
                throw new ArgumentNullException();
            }
            Contract.EndContractBlock();

            _entityByIdProvider             = entityByIdProvider;
            _entityWithIncludesByIdProvider = entityWithIncludesByIdProvider;
            _entityCreator   = entityCreator;
            _entityUpdater   = entityUpdater;
            _entityDestroyer = entityDestroyer;
        }