public JsonResult Add(GameParticipationViewModel gameParticipationViewModel) { var dbGameParticipation = Mapper.Map <GameParticipation>(gameParticipationViewModel); _gameParticipationService.AddGameParticipation(dbGameParticipation); return(Json(null, JsonRequestBehavior.AllowGet)); }
public void EditGameTableParticipations(List <GameParticipation> gameParticipations, Gamer modifiedGamer) { foreach (var gameParticipation in gameParticipations) { var dbGameParticipation = _gameParticipationService.GetGameParticipation(gameParticipation.Id); if (dbGameParticipation != null) { _gameParticipationService.Edit(gameParticipation); } else { _gameParticipationService.AddGameParticipation(gameParticipation); } } _gameTableRepository.EditGameTableParticipations(gameParticipations, modifiedGamer); }