internal VaultKeep CreateAsync(VaultKeep newVK, string userId) { List <VaultKeepModel> vk = _vkRepo.GetByVaultId(newVK.VaultId).ToList(); // List<VaultKeepModel> filtered = vk.Where(vk => vk.Keeps. == newVK.KeepId).ToList(); // if (filtered.Any()) // { // throw new Exception("You already added this."); // } return(_vkRepo.Create(newVK)); }
internal IEnumerable <VaultKeepModel> GetByVault(int id, string userId) { Vault curVault = _vService.Get(id, userId); if (curVault == null) { throw new Exception("Could not find this vault."); } if (curVault.IsPrivate == true && userId != curVault.CreatorId) { throw new Exception("You don't have access to this."); } return(_vkRepo.GetByVaultId(id)); }
public IEnumerable <Keep> GetByVaultId(int id) { return(_db.GetByVaultId(id)); }
internal IEnumerable <KeepViewModel> GetByVaultId(int vaultId) { return(_vksr.GetByVaultId(vaultId)); }