Exemplo n.º 1
0
        public async Task <ActionResult <IQueryable <GalleryModel> > > GetGalleriesAsync()
        {
            var query  = new GetAllGalleriesQuery();
            var result = await _mediator.Send(query);

            return(Ok(result));
        }
Exemplo n.º 2
0
 public async Task <IQueryable <GalleryModel> > Handle(GetAllGalleriesQuery request, CancellationToken cancellationToken)
 {
     try
     {
         var result = Context.Galleries.ProjectTo <GalleryModel>(Mapper.ConfigurationProvider);
         return(await Task.FromResult(result));
     }
     catch (System.Exception exeption)
     {
         throw new BadRequestException(exeption.Message);
     }
 }