public async Task <Response> CreateBooks(BookRequest book) { Response response = new Response(); var bookToCreate = new Book() { Id = 0, Name = book.Name, Author = book.Author, ISBN = book.ISBN }; var result = await _repositoryCommand.Create(bookToCreate); response.Data = result; return(response); }
public async Task <Response> CreateAuthor(AuthorCreateRequest request) { var response = new Response(); var AuthorToCreate = new Author() { Name = request.Name, Sex = request.Sex, Address = request.Address, BirthDate = request.BirthDate }; var result = await _repositoryCommand.Create(AuthorToCreate); response.Data = result; return(response); }