Exemplo n.º 1
0
        public async Task <ApiResult <Equipment> > PutAsync(Equipment model)
        {
            _logger.LogInformation(_localizer["LogMethodCalled", "api/Equipment/Put"]);
            ApiResult <Equipment> response = await _equipmentRepository.Edit(model);

            _logger.LogInformation(_localizer["LogMethodResult", "api/Equipment/Put", response.Deserialize()]);
            return(response);
        }
Exemplo n.º 2
0
        public ICommandResult Handle(EditEquipmentCommand command)
        {
            var equipment = new Equipment(command.Description, command.Status, command.PurchaseDate);

            AddNotifications(equipment.Notifications);

            if (Invalid)
            {
                return(new CommandResult(false, "Erro ao editar registro", Notifications));
            }

            _repository.Edit(command);
            return(new CommandResult(true, "Registro editado com sucesso", null));
        }
 public void Edit(Equipment entity)
 {
     _repository.Edit(entity);
 }