public Vault Get(int id) { Vault exists = _vr.Get(id); if (exists == null) { throw new Exception("Invalid Id"); } return(exists); }
internal IEnumerable <Vault> Get(string userId) { var found = _repo.Get(userId); if (found == null) { throw new Exception("Invalid id"); } return(found); }
internal Vault Get(int id) { Vault found = _repo.Get(id); if (found == null) { throw new Exception("Invalid Id"); } return(found); }
internal Vault Get(int id, string userId) { Vault found = _repo.Get(id); if (found == null) { throw new Exception("Invalid Id"); } if (found.UserId != userId) { throw new Exception("You are not the owner"); } return(found); }
/// <summary> /// creates a new relation. checks for private / public /// </summary> /// <param name="newRelation">a vaultKeep object representign the new assiciation</param> /// <param name="userId">the user trying to create the association</param> internal VaultKeep Create(VaultKeep newRelation, string userId) { Keep foundKeep = _krepo.Get(newRelation.KeepId, false); // two states: // found, is private, not created by person makign the request // found, not private if (foundKeep.IsPrivate && foundKeep.UserId != userId) { throw new ArgumentNullException(nameof(newRelation.KeepId), "That Keep does not exist"); } // found is public or we made it and it is private // _vrepo.Get does userId checking internally Vault foundVault = _vrepo.Get(newRelation.VaultId, userId); newRelation.UserId = userId; return(_repo.Create(newRelation)); }
public IEnumerable <Vault> Get(string userId) { return(_repo.Get(userId)); }
internal IEnumerable <Vault> Get(string userId) { // return _repo.Get(); return(_repo.Get(userId)); }
internal IEnumerable <Vault> Get(string currentUser) { return(_repo.Get(currentUser)); }
public Vault Get(int id) { return(_repo.Get(id)); }
internal object Get() { return(_repo.Get()); }
public List <Vault> Get() { return(_vrepo.Get()); }
public IEnumerable <Vault> Get(string userId) { IEnumerable <Vault> vault = _repo.Get(userId); return(vault); }
internal object Get(string userId) { return(_repo.Get(userId)); }
internal IEnumerable <Vault> Get() { return(_repo.Get()); }
public IEnumerable <Vault> Get() { return(_repo.Get()); }
public IEnumerable <Vault> GetMyVaults(string id) { return(_repo.Get(id)); }