示例#1
0
        public IActionResult Get([FromServices] IBookBusiness bookBusiness, [FromServices] IMapper mapper)
        {
            var resultDomain = bookBusiness.FindAll();
            var resultVO     = mapper.Map <List <BookValue> >(resultDomain);

            return(Ok(resultVO));
        }
示例#2
0
 public IActionResult Get()
 {
     return(Ok(_bookBusiness.FindAll().Select(x => (BookVO)GetUrl.GerarLinks(
                                                  x,
                                                  nameof(Get),
                                                  this.HttpContext, _linkGenerator))));
 }
示例#3
0
        public IActionResult Get()
        {
            var result = _bookBusiness.FindAll();

            if (result == null)
            {
                return(BadRequest());
            }

            return(Ok(result));
        }
示例#4
0
 public IActionResult Get()
 {
     try
     {
         var lista = _bookBusiness.FindAll();
         return(Ok(lista));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#5
0
        //   [AllowAnonymous]
        public IActionResult Get()
        {
            List <BookVO> books = new List <BookVO>();

            books = _bookBusiness.FindAll();

            if (books == null)
            {
                return(BadRequest());
            }

            foreach (var item in books)
            {
                item.Imagem = _bookRepository.GetImagBook(item);
            }

            return(Ok(books));
        }
 public IActionResult Get()
 {
     try
     {
         List <Book> books = new List <Book>(_bookBusiness.FindAll());
         if (books != null)
         {
             return(Ok(books));
         }
         else
         {
             return(NotFound());
         }
     }
     catch (Exception)
     {
         return(BadRequest());
     }
 }
 [TypeFilter(typeof(HyperMediaFilter))] // Anotação para o HATEOAS
 public IActionResult Get()
 {
     return(Ok(_bookBusiness.FindAll()));
 }
 public IActionResult Get()
 {
     return(new OkObjectResult(_bookBusiness.FindAll()));
 }
        public IActionResult Get()
        {
            var res = _booksBusiness.FindAll();

            return(Ok(res));
        }
 public ActionResult <IEnumerable <string> > Get()
 {
     return(Ok(_bookBusiness.FindAll()));
 }
示例#11
0
        public IActionResult Get()
        {
            var books = _bookBusiness.FindAll();

            return(Ok(books));
        }
 public IActionResult Get()
 {
     return(Ok(_personBusiness.FindAll()));
 }