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)); } }
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)); } }