public void Handle(RemoveMatchRequest request) { try { //_matchRepo.Delete(request.Id); var match = _matchRepo.Get(request.Id); match.IsDeleted = true; _matchRepo.Replace(match); var response = new RemoveMatchResponse(true); Sender.Tell(response); _logger.Info("Remove Match successfull: {0} {1}", match.FirstTeam, match.SecondTeam); } catch (Exception ex) { var response = new RemoveMatchResponse(false); Sender.Tell(response); _logger.Error("Couldn't remove Match: {0}:", request.Id, ex.Message); } }
public async Task <RemoveMatchResponse> RemoveMatch(string id) { var request = new RemoveMatchRequest(id); return(await _matchActor.Ask <RemoveMatchResponse>(request)); }