コード例 #1
0
ファイル: TaskController.cs プロジェクト: Myrku/OmegaTaskBack
 public IActionResult AddTask([FromBody] Models.Task task)
 {
     try
     {
         if (task != null)
         {
             var user = userDb.GetUserById(Convert.ToInt32(User.FindFirst(claimIdType)?.Value));
             task.Id = db.AddTaskWithGetRowId(task, user.Id.ToString()).Result;
             JobScheduler.AddTaskTriggerForJob(task, user);
             return(Ok());
         }
         else
         {
             return(BadRequest());
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex.Message);
         throw;
     }
 }