public async Task <ActionResult <Author> > CreateAuthor( [FromBody] Author author ) { _dbContext.Authors.Add(author); await _dbContext.SaveChangesAsync(); return(StatusCode(201, author)); }
public async Task <ActionResult <Genre> > CreateGenre( [FromBody] Genre genre ) { _dbContext.Genres.Add(genre); await _dbContext.SaveChangesAsync(); return(StatusCode(201, genre)); }
public async Task <ActionResult <Author> > CreateAuthor( [FromBody] Book book ) { _dbContext.Books.Add(book); await _dbContext.SaveChangesAsync(); return(StatusCode(201, book)); }