コード例 #1
0
 public void CreateHintHistory(GameSessionUseHintHistory hintHistory)
 {
     try
     {
         hintHistoryRepository.CreateHintHIstory(hintHistory);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #2
0
 public ActionResult CreateHintHistory([FromBody] GameSessionUseHintHistory hintHistory)
 {
     try
     {
         hintHistoryService.CreateHintHistory(hintHistory);
         return(new JsonResult("Success"));
     }
     catch (Exception ex)
     {
         return(new JsonResult("Error"));
     }
 }
コード例 #3
0
 public void CreateHintHIstory(GameSessionUseHintHistory hintHistory)
 {
     try
     {
         if (hintHistory != null)
         {
             context.GameSessionUseHintHistories.Add(hintHistory);
             context.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }
コード例 #4
0
 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);
     }
 }