Beispiel #1
0
        public async Task <ActionResult <Todo> > CreateOne([FromBody] Todo newTodo)
        {
            try
            {
                Profile userInfo = await HttpContext.GetUserInfoAsync <Profile>();

                newTodo.CreatorId = userInfo.Id;
                newTodo.Creator   = userInfo;
                return(Ok(_cservice.CreateOne(newTodo)));
            }
            catch (System.Exception err)
            {
                return(BadRequest(err.Message));
            }
        }