Beispiel #1
0
        public async Task <bool> UpdateAsync(TEntity obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException();
            }
            Contract.EndContractBlock();

            var result = await _entityUpdater.UpdateAsync(obj);

            if (!result)
            {
                _entityUpdater.ResolveErrors(_validationErrors, exception => ExceptionMessage = exception);
            }
            return(result);
        }
        public virtual async Task <bool> UpdateAsync(TEntity obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException();
            }
            Contract.EndContractBlock();

            if (_entityWithIncludesProvider == null)
            {
                throw new NullReferenceException("Entity updater is null. Make sure it is injected in constructor.");
            }
            var result = await _entityUpdater.UpdateAsync(obj);

            if (!result)
            {
                _entityUpdater.ResolveErrors(_validationErrors, exception => ExceptionMessage = exception);
            }
            return(result);
        }