public async Task <IActionResult> AddResult([FromBody] AddResult result) { var user = await _userManger.GetUserAsync(User); int isOk = await _resultService.AddNewResult(result, user.Id); var userStatus = new UserViewModel(); if (isOk == 0) { userStatus.Status = "ok"; return(Ok(userStatus)); } else if (isOk == -1) { userStatus.Errors = new string[] { "Bad Score" }; } else if (isOk == -2) { userStatus.Errors = new string[] { "Bad League" }; } else { userStatus.Errors = new string[] { "Unknow Errror" }; } userStatus.Status = "Error"; return(BadRequest(userStatus)); }