Example #1
0
        public async Task <GeneralCategoryDto> Update(GeneralCategoryDto category)
        {
            var entity        = _mapper.Map <GeneralCategory>(category);
            var modelToUpdate = await _categoryRepository.FindByCondition(x => x.Id == entity.Id);

            if (!modelToUpdate.Any())
            {
                throw new ApiException("No se pudo editar la GeneralCategory", HttpStatusCode.NotFound);
            }
            _categoryRepository.Update(entity);
            return(_mapper.Map <GeneralCategoryDto>(entity));
        }
Example #2
0
 public bool Update(GeneralCategory entity)
 {
     return(Repository.Update(entity));
 }