Example #1
0
        public async Task <GetByIdBookView> GetById(int id)
        {
            var book = await _bookrepository.GetById(id);

            var result = new GetByIdBookView();

            result.Id    = book.Id;
            result.Title = book.Title;
            result.Price = book.Price;
            return(result);
        }
Example #2
0
        public async Task <GetByIdBookView> GetById(Guid id)
        {
            var book = await _bookRepository.GetById(id);

            var model = new GetByIdBookView()
            {
                Id     = book.Id,
                Author = book.Author,
                Name   = book.Name,
                Price  = book.Price
            };

            return(model);
        }