Esempio n. 1
0
        public IActionResult AddBktoAuthor([FromBody] Author value)
        {
            if (value == null)
            {
                return(BadRequest());
            }
            //value.AuthorId = id;
            _authorRepository.AddBooktoAuthor(value);
            var note = _authorRepository.GetById(value.AuthorId);

            //var response = new { MessageBody = "Successfully Added Book to Author" };
            //return Ok(response);
            return(CreatedAtRoute("GetAuthor", new { id = note.AuthorId }, note));
        }