public void ReturnCorrectDeleteSeatCommand() { var com = new DeleteSeatDomainCommand(1); Assert.AreEqual(com.Command, DeleteSpCommandPattern.DeleteSeat); Assert.NotNull(com.Id); Assert.AreEqual(com.Id, 1); }
/// <inheritdoc /> public async Task <DomainCommandResponse> Handle(DeleteSeatDomainCommand request, CancellationToken cancellationToken) { try { this.UnitOfWork.SeatRepository.Delete(request.ProjectedAs <Seat>()); var retResp = new DomainCommandResponse { IsSuccess = true, Message = "Entity was Deleted", Object = request }; return(await Task.FromResult(retResp)); } catch (Exception ex) { var ret = new DomainCommandResponse { Message = ex.Message }; return(await Task.FromResult(ret)); } }