示例#1
0
        public async Task <bool> UpdateAsync(StorageLocationUpdateViewModel storageLocationViewModel)
        {
            var storageLocation = _mapper.Map <StorageLocationUpdateViewModel, StorageLocation>(storageLocationViewModel);
            var affectedRows    = await _storageLocationRepository.UpdateAsync(storageLocation);

            if (affectedRows > 0)
            {
                return(true);
            }

            return(false);
        }
示例#2
0
        public async Task <IActionResult> UpdateStorageLocation(StorageLocationUpdateViewModel storageLocation)
        {
            try
            {
                var success = await _storageLocationService.UpdateAsync(storageLocation);

                if (success)
                {
                    return(NoContent());
                }

                return(BadRequest($"Erro ao atualizar produto"));
            }
            catch (Exception ex)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, ex));
            }
        }