public ActionResult AthletResult([FromForm] AthletViewModel athletResults) { var athletResult = _athletService.GetAthletFitness(athletResults.id, athletResults.result); Console.WriteLine(athletResult.id + " : " + athletResult.result); return(Ok(athletResult)); }
/// <summary> /// Get Athlet Fitness for showing on view /// </summary> /// <param name="athletId"></param> /// <param name="result"></param> /// <returns></returns> public AthletViewModel GetAthletFitness(int athletId, string result) { var athletResult = new AthletViewModel(); var athletList = _athletRepository.GetAthlets(); int editIndex = athletList.FindIndex(o => o.id == athletId); athletResult.id = athletList[editIndex].id; athletResult.result = result; return(athletResult); }