Exemplo n.º 1
0
        public IActionResult GetBooks(ODataQuery oDataQuery)
        {
            var entities = BooksService.Get();

            var result = oDataQuery.ApplyTo <Book, BookDTO>(entities);

            return(Ok(result));
        }
Exemplo n.º 2
0
        public IActionResult GetAuthors(ODataQuery oDataQuery)
        {
            var authors = AuthorsService.Get();

            //var result = Mapper.Map<Author, AuthorDTO>(authors);

            var result = oDataQuery.ApplyTo <Author, AuthorDTO>(authors);

            return(Ok(result.ToList()));
        }