public void ShouldReturnValidWhenDeleteCommandIsValid() { var command = new DeleteEquipmentCommand(); command.Id = Guid.NewGuid(); var result = _handler.Handle(command); Assert.AreEqual(true, result.Status); }
public Task <HttpResponseMessage> Delete(int id) { //var company = _service.Delete(id); var command = new DeleteEquipmentCommand( idEquipment: id ); var equipment = _service.Delete(command); return(CreateResponse(HttpStatusCode.OK, equipment)); }
public void Delete(DeleteEquipmentCommand command) { _db.Connection().Execute( "spDeleteEquipment", new { id = command.Id }, commandType: CommandType.StoredProcedure ); }
public Equipment Delete(DeleteEquipmentCommand command) { var equipment = _repository.GetById(command.IdEquipment); equipment.Delete(); _repository.Delete(equipment); if (Commit()) { return(equipment); } return(null); }
public ICommandResult Handle(DeleteEquipmentCommand command) { string id = command.Id.ToString(); if (string.IsNullOrEmpty(id)) { AddNotification("Id", "Identificador inválido"); } if (Invalid) { return(new CommandResult(false, "Erro ao deletar registro", Notifications)); } _repository.Delete(command); return(new CommandResult(true, "Registro deletado com sucesos", null)); }
public ICommandResult Delete(DeleteEquipmentCommand command) { return(_handler.Handle(command)); }
public void Delete(DeleteEquipmentCommand command) { }