public ActionResult EditBattle(Guid id) { var dto = _battleService.GetBattleById(id); var model = _mapper.Map <BattleViewModel>(dto); return(View(model)); }
public IActionResult PostBattleActions(int battleId, [FromBody] List <BattleAction> battleActions) { var battle = _battleService.GetBattleById(battleId); if (battle != null && battleActions != null) { // check to make sure authenticated user is the user for this battle // TODO: Validate authenticated user versus battle user var result = battle.DoRound(battleActions); return(Json(result)); } return(BadRequest()); }