Пример #1
0
 public ActionResult <IEnumerable <VaultKeepViewModel> > GetKeepsByVaultId(int vaultId)
 {
     try {
         var userId = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
         return(Ok(_vks.GetKeepsByVaultId(vaultId, userId)));
     } catch (Exception e) {
         return(BadRequest(e.Message));
     }
 }
Пример #2
0
 public ActionResult <IEnumerable <Vault> > GetKeepsByVaultId(int id)
 {
     try
     {
         return(Ok(_vaultKeepsService.GetKeepsByVaultId(id)));
     }
     catch (System.Exception error)
     {
         return(BadRequest(error.Message));
     }
 }
Пример #3
0
 public ActionResult <Vault> GetKeepsByVaultId(int id)
 {
     try
     {
         return(Ok(_vks.GetKeepsByVaultId(id)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Пример #4
0
 public ActionResult <IEnumerable <Keep> > Get(int vaultId)
 {
     try
     {
         return(Ok(_vks.GetKeepsByVaultId(vaultId)));
     }
     catch (System.Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Пример #5
0
 public ActionResult <IEnumerable <VaultKeepViewModel> > GetKeepsByVaultId(int id)
 {
     try
     {
         return(Ok(_vks.GetKeepsByVaultId(id)));
     }
     catch (System.Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
Пример #6
0
 public ActionResult <IEnumerable <VaultKeepViewModel> > Get(int vaultId)
 {
     try
     {
         string userId = findUserInfo();
         return(Ok(_vks.GetKeepsByVaultId(userId, vaultId)));
     }
     catch (System.Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
Пример #7
0
        public async Task <ActionResult <List <KeepViewModel> > > GetKeepsByVaultId(int id)
        {
            try
            {
                var userInfo = await HttpContext.GetUserInfoAsync <Account>();

                if (userInfo == null)
                {
                    List <KeepViewModel> keeps = _vks.GetKeepsByVaultId(id);
                    return(Ok(keeps));
                }
                else
                {
                    List <KeepViewModel> keeps = _vks.GetKeepsByVaultId(id, userInfo?.Id);
                    return(Ok(keeps));
                }
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
Пример #8
0
 public ActionResult <IEnumerable <Keep> > GetKeepsbyVaultId(int vaultId)
 {
     try
     {
         string             userId     = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
         IEnumerable <Keep> vaultkeeps = _vks.GetKeepsByVaultId(vaultId, userId);
         return(Ok(vaultkeeps));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Пример #9
0
        [HttpGet("{vaultId}")] //Path: api/vaultkeeps/:vaultId/
        public async Task <ActionResult <VaultKeep> > GetKeepsByVaultById(int vaultId)
        {
            try
            {
                Profile userInfo = await HttpContext.GetUserInfoAsync <Profile>();

                IEnumerable <Keep> res = _serv.GetKeepsByVaultId(userInfo?.Id, vaultId);
                return(Ok(res));
            }
            catch (System.Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
Пример #10
0
 public ActionResult <IEnumerable <VaultKeepViewModel> > GetKeepsByVaultId(int id)
 {
     try
     {
         var userId = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
         return(Ok(_vks.GetKeepsByVaultId(id, userId)));
         // return Ok(_vs.GetById(id));
         // TODO call to the vault keep service. pass it the vault id,
         // TODO vault keep service call vault keep repsitory, to get vaultkeepsbyvaultId.
     }
     catch (System.Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
Пример #11
0
 public ActionResult <VaultKeepViewModel> GetKeepsByVaultId(int id)
 {
     try
     {
         Claim  user    = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier);
         string getUser = user.Value;
         if (user == null)
         {
             throw new Exception("Please Login to Continue!");
         }
         return(Ok(_vk.GetKeepsByVaultId(id, getUser)));
     }
     catch (System.Exception e)
     {
         return(BadRequest(e.Message));
     };
 }
Пример #12
0
        public ActionResult <IEnumerable <Keep> > GetKeepsByVaultId(int id)
        {
            string userId = HttpContext.User.FindFirstValue("Id");

            return(Ok(_service.GetKeepsByVaultId(id, userId)));
        }
Пример #13
0
        public ActionResult <IEnumerable <VaultKeepVM> > GetKeepsByVaultId(int id)
        {
            string userId = HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;

            return(Ok(_vks.GetKeepsByVaultId(id, userId)));
        }