Exemple #1
0
        //[Authorize("add:author")] Disabled authentication for this test
        public IActionResult AddAuthor([FromBody] Author author)
        {
            string createdId;

            try
            {
                createdId = _dataController.AddAuthor(author);
            }
            catch (Exception e)
            {
                return(BadRequest(new
                {
                    e.Message
                }));
            }
            return(Json(new
            {
                Message = $"Author ({createdId}) successfully registered"
            }));
        }