private DTOVaultKeep Get(int id) { DTOVaultKeep exists = _repo.GetById(id); if (exists == null) { throw new Exception("Invalid Vault Id"); } return(exists); }
public VaultKeep GetById(int id) { var foundVaultKeep = _repo.GetById(id); if (foundVaultKeep == null) { throw new Exception("Invalid Id"); } return(foundVaultKeep); }
internal VaultKeep GetById(int id) { var data = _repo.GetById(id); if (data == null) { throw new Exception("Invalid Id"); } return(data); }
internal DTOVaultKeep GetById(int Id) { DTOVaultKeep exists = _repo.GetById(Id); if (exists == null) { throw new Exception("Invalid VaultKeep"); } return(exists); }
internal VaultKeep getVaultKeepById(int id) { VaultKeep vk = _repo.GetById(id); if (vk == null) { throw new Exception("Bad VaultKeep Id"); } return(vk); }
public DTOVaultKeep GetById(int id) { DTOVaultKeep exists = _repo.GetById(id); if (exists == null) { throw new Exception("Invalid vaultKeepid"); } return(exists); }
private VaultKeep GetById(int id) { VaultKeep found = _repo.GetById(id); if (found == null) { throw new Exception("invalid Id"); } return(found); }
public ActionResult <VaultKeeps> Get(string userId) { IEnumerable <VaultKeeps> found = _vkr.GetById(userId); if (found == null) { return(BadRequest()); } return(Ok(found)); }
internal void Delete(int id, string userId) { VaultKeep vk = _vkrepo.GetById(id); if (vk == null) { throw new Exception("Invalid Id"); } if (vk.CreatorId != userId) { throw new Exception("Invalid User"); } _vkrepo.Delete(id, vk.KeepId); }
internal void Delete(int id, string userId) { VaultKeepViewModel vkm = _repo.GetById(id); if (vkm == null) { throw new Exception("Invalid vkm"); } if (vkm.CreatorId != userId) { throw new Exception("Invalid User"); } _repo.Delete(id); }
///<summary> ///Deletes Vault-Keep, checks that the vault-keep is an actual vault-keep, then it checks if the user is /// the original creator of said vault-keep. ///</summary> internal void Delete(int id, string userId) { VaultKeep keep = _repo.GetById(id); if (keep == null) { throw new Exception("Invalid aye"); } if (keep.CreatorId != userId) { throw new Exception("Invalid User"); } _repo.Delete(id); }
public VaultKeep Get(int id, string userId) { VaultKeep exists = _repo.GetById(id); if (exists == null) { throw new System.Exception("VaultKeep does not exist!"); } if (exists.userId != userId) { throw new System.Exception("VaultKeep does not belong to you."); } return(exists); }
internal void delete(int id, string userId) { VaultKeep toDelete = _repo.GetById(id); if (toDelete == null) { throw new Exception("invalid id"); } if (toDelete.CreatorId != userId) { throw new Exception("cannot delete if you are not the creator"); } _repo.Delete(id); }