예제 #1
0
        internal Vault GetOneVault(int id)
        {
            Vault vault = _vrepo.GetOneVault(id);

            if (vault == null)
            {
                throw new SystemException("Invalid Id: This vault does not exist or the wrong Id was passed in the get one request.");
            }
            if (vault.IsPrivate)
            {
                throw new SystemException("You are not the owner of this vault.");
            }
            return(vault);
        }
예제 #2
0
        public ActionResult <Vault> GetVault(int id)
        {
            Vault result = _repo.GetOneVault(id);

            if (result != null)
            {
                return(Ok(result));
            }
            return(BadRequest());
        }