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); }
public Author AddAuthor(AuthorInputType authorInputType) { var author = new Author() { Name = authorInputType.Name, Surname = authorInputType.SurName }; _dbContext.Author.Add(author); _dbContext.SaveChanges(); return(author); }
public Book AddBook(BookInputType bookInputType) { var book = new Book() { Title = bookInputType.Title, AuthorId = bookInputType.AuthorId, Price = bookInputType.Price }; _dbContext.Book.Add(book); _dbContext.SaveChanges(); return(book); }