Exemplo n.º 1
0
        public void AddAuthor(JsonAuthor author)
        {
            var authorToAdd = new Author
            {
                Name    = author.Name,
                Email   = author.Email,
                Details = author.Details
            };

            _context.Authors.Add(authorToAdd);
            _context.SaveChanges();
        }
Exemplo n.º 2
0
 public IActionResult AddAuthor([FromBody] JsonAuthor author)
 {
     _repository.AddAuthor(author);
     return(Json(author));
 }