public void CreateHintHistory(GameSessionUseHintHistory hintHistory) { try { hintHistoryRepository.CreateHintHIstory(hintHistory); } catch (Exception ex) { throw; } }
public ActionResult CreateHintHistory([FromBody] GameSessionUseHintHistory hintHistory) { try { hintHistoryService.CreateHintHistory(hintHistory); return(new JsonResult("Success")); } catch (Exception ex) { return(new JsonResult("Error")); } }
public void CreateHintHIstory(GameSessionUseHintHistory hintHistory) { try { if (hintHistory != null) { context.GameSessionUseHintHistories.Add(hintHistory); context.SaveChanges(); } } catch (Exception ex) { throw; } }
public async Task CreateHistory(int gameSessionId, int userId, int riddleId, string hintName, string oldValue, string newValue) { try { var history = new GameSessionUseHintHistory() { GameSessionId = gameSessionId, UserId = userId, HintId = Hints.DictionaryHints.ContainsKey(hintName) ? Hints.DictionaryHints[hintName].Id : 1, RiddleId = riddleId, OldAnswerValue = oldValue, NewAnswerValue = newValue, UseDate = DateTime.Now }; await client.PostAsJsonAsync <GameSessionUseHintHistory>($"api/hinthistory/createhinthistory", history); } catch (Exception ex) { Console.WriteLine(ex.Message); } }