Exemplo n.º 1
0
        internal IEnumerable <Keep> GetByVaultId(int vaultId, string userId)
        {
            Vault vault = _vr.Find(vaultId);

            if (vault == null)
            {
                throw new Exception("Bad Id");
            }
            if (vault.CreatorId != userId && vault.IsPrivate)
            {
                throw new Exception("Not Public.. ask owner to make public?");
            }
            else
            {
                return(_repo.Find(vaultId));
            }
        }