Exemple #1
0
 public async Task <ActionResult <bool> > GetAsync(string rId)
 {
     //Since this method is authorized by Identity, it will automatically handle returning 401 if user isn't logged in.
     try
     {
         return((await Arepo.GetBlacklistForUserAsync(User.Identity.Name)).Any(n => n.Id.Equals(rId)));
     }
     catch (Exception e)
     {
         logger.Error(e, e.ToString());
         return(StatusCode(StatusCodes.Status500InternalServerError));
     }
 }
Exemple #2
0
 public async Task <ActionResult <List <RestaurantModel> > > GetAsync()
 {
     //Since this method is authorized by Identity, it will automatically handle returning 401 if user isn't logged in.
     try
     {
         return(Mapper.Map(await Arepo.GetBlacklistForUserAsync(User.Identity.Name)).ToList());
     }
     catch (Exception e)
     {
         logger.Error(e, e.ToString());
         return(StatusCode(StatusCodes.Status500InternalServerError));
     }
 }