restart matches on certain score

This commit is contained in:
chsakell
2016-10-16 10:57:29 +03:00
parent 6db505ed91
commit 840373489c
3 changed files with 22 additions and 3 deletions

View File

@@ -35,8 +35,14 @@ namespace LiveGameFeed.Controllers
public async void Put(int id, [FromBody]MatchScore score)
{
Match _match = _matchRepository.GetSingle(id);
if (score.HostScore == 0 && score.GuestScore == 0)
{
_match.Feeds.Clear();
}
_match.HostScore = score.HostScore;
_match.GuestScore = score.GuestScore;
_matchRepository.Commit();
MatchViewModel _matchVM = Mapper.Map<Match, MatchViewModel>(_match);