Esempio n. 1
0
        public IHttpActionResult Post(ProjectInputDto item)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    var itemId = _projectAppService.CreateorUpdateProject(item);
                    if (itemId.Status == TaskStatus.RanToCompletion)
                    {
                        return(Ok(itemId));
                    }
                    else
                    {
                        if (itemId.Exception != null)
                        {
                            return(BadRequest(itemId.Exception.Message));
                        }
                    }
                }
                catch (Exception execption)
                {
                    return(BadRequest(execption.Message));
                }
            }

            return(BadRequest(ModelState));
        }