コード例 #1
0
        public async Task <IActionResult> CreateWorkFlow([FromBody] WorkflowViewModel workflowViewModel)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    var workFlow   = _mapper.Map <WorkFlowMaster>(workflowViewModel);
                    var workflowId = await workFlowRepository.CreateNewWorkFlow(workFlow);

                    if (workflowId > 0)
                    {
                        return(Ok(workflowId));
                    }
                    else
                    {
                        return(NotFound());
                    }
                }
                catch (Exception)
                {
                    return(BadRequest());
                }
            }

            return(BadRequest());
        }