public void ReturnCorrectDeleteVenueCommand() { var com = new DeleteVenueDomainCommand(1); Assert.AreEqual(com.Command, DeleteSpCommandPattern.DeleteVenue); Assert.NotNull(com.Id); Assert.AreEqual(com.Id, 1); }
/// <inheritdoc /> public async Task <DomainCommandResponse> Handle(DeleteVenueDomainCommand request, CancellationToken cancellationToken) { try { this.UnitOfWork.VenueRepository.Delete(request.ProjectedAs <Venue>()); 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)); } }