public VaultKeep GetById(int id) { var data = _repo.GetById(id); if (data == null) { throw new Exception("Invalid Id"); } return(data); }
internal IEnumerable <Keep> GetById(Vault v) { var found = _repo.GetById(v); // if (found == null) { throw new Exception("Invalid id"); } // if (found.ElementAt(0).UserId != userId) { throw new Exception("Unauthorized"); } return(found); }
public VaultKeep GetById(int Id) { VaultKeep exists = _repo.GetById(Id); if (exists == null) { throw new Exception("Invalid keep id"); } return(exists); }
internal IEnumerable <Keep> GetById(int vid, string userId) { var found = _repo.GetById(vid, userId); if (found == null) { throw new Exception("Invalid id"); } return(found); }
private DTOVaultKeep GetById(int id) { var found = _repo.GetById(id); if (found == null) { throw new Exception("Invalid Id"); } return(found); }
internal VaultKeep GetById(int id) { var res = _repo.GetById(id); if (res == null) { throw new System.Exception("Bad id, please check your input and try again"); } return(res); }
internal void Delete(int id) { var data = _repo.GetById(id); // if (data == null) // { // throw new Exception("Invalid Id"); // } _repo.Delete(id); }
// internal void Create(VaultKeep newVaultKeep) // { // VaultKeep existence = _repo.Find(newVaultKeep); // if (existence != null) { return; } // _repo.Create(newVaultKeep); // } internal VaultKeep GetById(int id) { var existenceTest = _repo.GetById(id); if (existenceTest == null) { throw new Exception("Bad Id"); } return(existenceTest); }
public DTOVaultedKeep Get(int Id) { DTOVaultedKeep found = _repo.GetById(Id); if (found == null) { throw new Exception("Keep cannot be placed in vault"); } return(found); }
public VaultKeep GetById(int id) { VaultKeep foundVK = _repo.GetById(id); if (foundVK == null) { throw new Exception("Invalid VaultKeep Id"); } return(foundVK); }
internal DTOVaultKeep GetById(int id) //TODO call in a different controller than VKC { DTOVaultKeep exists = _repo.GetById(id); if (exists == null) { throw new Exception("ur wrong bub"); } return(exists); }
public VaultKeep Get(int id, string userId) { VaultKeep exists = _repo.GetById(id, userId); if (exists == null) { throw new Exception("Wrong Keep Bud!"); } return(exists); }
public VaultKeep GetById(int id) { VaultKeep foundVaultKeep = _repo.GetById(id); if (foundVaultKeep == null) { throw new Exception("invalid id"); } return(foundVaultKeep); }
public string Delete(int vaultId, int keepId, string userId) { var exists = _repo.GetById(vaultId, keepId, userId); if (exists == null) { throw new Exception("Invalid request"); } _repo.Delete(vaultId, keepId, userId); return("Successfully Deleted"); }
internal object Delete(int id, Profile userInfo) { VaultKeep data = _repo.GetById(id); if (data.CreatorId != userInfo.Id || data == null) { throw new Exception("Invalid Id, Or Invalid Permissions"); } _repo.Delete(id); return("Successfully Deleted!"); }
internal string Delete(int id) { var exists = _repo.GetById(id); if (exists == null) { throw new Exception("Invalid id combination"); } _repo.Delete(id); return("Successfully Deleted"); }
internal void Delete(int id, string userId) { VaultKeep original = _repo.GetById(id); if (original == null) { throw new Exception("Invalid Id"); } if (original.CreatorId != userId) { throw new Exception("You cannot delete that which is not yours."); } _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) { var vk = _repo.GetById(id); if (vk == null) { throw new Exception("Invalid Id"); } if (vk.CreatorId != userId) { throw new Exception("Access Denied"); } _repo.Delete(id); }
public VaultKeepViewModel GetById(int id, string userId) { VaultKeepViewModel foundVaultKeep = _repo.GetById(id, userId); if (foundVaultKeep == null) { throw new Exception("Invalid Id"); } if (foundVaultKeep.UserId != userId) { throw new Exception("This is not yours!"); } return(foundVaultKeep); }
internal VaultKeep Delete(int id, string userId) { VaultKeep foundVaultKeep = _repo.GetById(id); if (foundVaultKeep.UserId != userId) { throw new Exception("This is not your VaultKeep!"); } if (_repo.Delete(id)) { return(foundVaultKeep); } throw new Exception("Need a mulligan on deleting this VaultKeep?"); }
internal string Delete(int vaultId, int keepId, string userId) { VaultKeep exists = _repo.GetById(vaultId, keepId, userId); if (exists == null) { throw new Exception("Invalid Id Delete"); } else if (exists.UserId != userId) { throw new Exception("This isnt yours, so you cant delete it!"); } _repo.Delete(vaultId, keepId, userId); return("This thing is gone!"); }
internal VaultKeep Delete(int id, string userInfoId) { VaultKeep data = _vaultKeepRepo.GetById(id); if (data == null) { throw new Exception("Invalid Id"); } if (data.CreatorId != userInfoId) { throw new Exception("Invalid Edit Permissions"); } _vaultKeepRepo.Delete(id); return(data); }
internal string Delete(int vaultId, int keepId, string userId) { var exists = _vaultKeepRepo.GetById(vaultId, keepId); if (exists == null) { throw new Exception("Item Does not Exist"); } else if (exists.UserId != userId) { throw new Exception("not yours to delete killer"); } _vaultKeepRepo.Delete(exists.Id); return("VaultKeep has been deleted!"); }
public string Delete(int vaultId, int keepId, string userId) { var exists = _repo.GetById(vaultId, keepId); if (exists == null) { throw new Exception("INVALID ID COMBO"); } else if (exists.UserId != userId) { throw new Exception("THIS AINT YOURS FOOL!"); } _repo.Delete(exists.Id); return("SHE GONE"); }
internal string Delete(int id, string userId) { VaultKeep original = _repo.GetById(id); if (original == null) { throw new Exception("Invalid Id"); } if (original.CreatorId != userId) { throw new Exception("You can only delete your own Keeps"); } _repo.Delete(id); return("removed from list"); }
internal void Create(VaultKeep newData) { VaultKeep exists = _repo.GetById(newData.Id); if (exists != null) { throw new Exception("Relationship already exists"); } // Pretty sure I don't need this on create... // else if (exists.UserId != newData.UserId) // { // throw new Exception(""); // } _repo.Create(newData); }
internal object DeleteVaultKeep(int id, string userId) { VaultKeep data = _repo.GetById(id); if (data == null) { throw new Exception("Invalid Id... from vaultkeepsService"); } if (data.CreatorId != userId) { throw new Exception("Access Denied NOT YOURS... from vaultkeepsService"); } _repo.DeleteVaultKeep(id); return("Successfully deleted... from vaultkeepsService"); }
internal VaultKeep Delete(string userId, int queryId) { var data = _repo.GetById(queryId); if (data == null) { throw new Exception("invalid Id"); } if (data.CreatorId != userId) { throw new Exception("This is not yours"); } var deleted = _repo.Delete(queryId); return(deleted); }
// public IEnumerable<VaultKeepViewModel> Get(string userId) // { // return _repo.Get(userId); // } public VaultKeep Get(int id) { return(_repo.GetById(id)); }