コード例 #1
0
        protected AssociationClassRepositoryBase(IProvideAssociationClassItemByIds <TEntity, FirstId, SecondId> entityProvider, ICreateEntity <TEntity> entityCreator,
                                                 IUpdateEntity <TEntity> entityUpdater, IDeleteAssociationClassEntity <TEntity, FirstId, SecondId> entityDestroyer)
        {
            if (entityProvider == null || entityCreator == null || entityUpdater == null || entityDestroyer == null)
            {
                throw new ArgumentNullException();
            }
            Contract.EndContractBlock();

            _entityProvider  = entityProvider;
            _entityCreator   = entityCreator;
            _entityUpdater   = entityUpdater;
            _entityDestroyer = entityDestroyer;
        }
コード例 #2
0
        protected AssociationClassCrudServiceBase(IProvideAssociationClassItemByIds <TEntity, FirstId, SecondId> entityProvider, ICreateEntityWithValidation <TEntity> entityCreator,
                                                  IUpdateEntityWithValidation <TEntity> entityUpdater, IDeleteAssociationClassEntityWithValidation <TEntity, FirstId, SecondId> entityDestroyer)
        {
            if (entityProvider == null || entityCreator == null || entityUpdater == null || entityDestroyer == null)
            {
                throw new ArgumentNullException();
            }
            Contract.EndContractBlock();

            _validationErrors = new Dictionary <string, string>();
            _entityProvider   = entityProvider;
            _entityCreator    = entityCreator;
            _entityUpdater    = entityUpdater;
            _entityDestroyer  = entityDestroyer;
        }