Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }