Пример #1
0
        public VaultKeep Create(VaultKeep newVaultKeep)
        {
            var exists = _vkRepo.GetByIds(newVaultKeep.VaultId, newVaultKeep.KeepId);

            if (exists != null)
            {
                throw new Exception("Pic already in vault");
            }
            _vkRepo.Create(newVaultKeep);
            return(newVaultKeep);
        }
Пример #2
0
        internal object Delete(int vaultId, int keepId, string userId)
        {
            VaultKeep exists = _repo.GetByIds(vaultId, keepId, userId);

            if (exists == null)
            {
                throw new Exception("Invalid Id or You Did Not Create This VaultKeep");
            }
            _repo.Delete(vaultId, keepId, userId);
            return("Successfully Deleted");
        }