Ejemplo n.º 1
0
        public string Delete(int id, string userId)
        {
            VaultKeep found = _repo.GetVaultKeepById(id);

            if (found == null || found.CreatorId != userId)
            {
                throw new Exception("Invalid Request");
            }
            if (_repo.Delete(id))
            {
                return("Successfully Deleted!");
            }
            return("Unsuccessful Deletion");
        }
Ejemplo n.º 2
0
        internal IEnumerable <VaultKeep> GetVaultKeepById(int id, string userId)
        {
            var exists = _repo.GetVaultKeepById(id, userId);

            if (exists == null)
            {
                throw new Exception("Invalid Id");
            }
            return(exists);
        }
Ejemplo n.º 3
0
        // NOTE Get Requests
        public VaultKeep GetVaultKeepById(int id)
        {
            VaultKeep foundVaultKeep = _repo.GetVaultKeepById(id);

            if (foundVaultKeep == null)
            {
                throw new Exception("Invalid Id");
            }
            return(foundVaultKeep);
        }