public Author AddAuthor(AuthorInputType author) { var authorObj = new Author() { Name = author.Name, Surname = author.Surname, }; context.Add(authorObj); context.SaveChanges(); return(authorObj); }
public Book AddBook(BookInputType book) { var bookObj = new Book() { AuthorId = book.AuthorId, Title = book.Title, Price = book.Price }; context.Add(bookObj); context.SaveChanges(); return(bookObj); }