コード例 #1
0
        public async Task <ActionResult> PostTaskToPlanAsync([FromBody] TaskDTO value, int?selectedPriority, int?selectedSection)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest());
                }
                var success = await taskService.AddTaskToPlanAsync(value, selectedPriority, selectedSection);

                if (success == true)
                {
                    return(Ok());
                }
                else
                {
                    return(BadRequest());
                }
            }
            catch (Exception e)
            {
                logger.LogInformation("Error :  {0}", e);
                return(BadRequest(e));
            }
        }