Exemplo n.º 1
0
 public ActionResult <IEnumerable <Keep> > GetKeepByUser()
 {
     try
     {
         var uId = HttpContext.User.FindFirstValue("Id");
         return(Ok(_repo.GetKeepsByUser(uId)));
         // return (uId);
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Exemplo n.º 2
0
 public ActionResult <IEnumerable <Keep> > Get(string user)
 {
     try
     {
         var userId = HttpContext.User.FindFirstValue("Id");
         // value.UserId = userId;
         if (userId == null)
         {
             throw new Exception("Login In To Get Your Keeps");
         }
         // value.something = something;
         return(Ok(_repo.GetKeepsByUser(userId)));
     }
     catch (Exception e)
     {
         return(BadRequest(e));
     }
 }