public IEnumerable <Keep> Get() { var exists = _repo.Get(); if (exists == null) { throw new Exception("There are no keeps"); } return(exists); }
internal Keep Get(int Id) { //NOTE If you do not null check you could get a 204 (No Context) if the blog was not found Keep found = _repo.Get(Id); if (found == null) { throw new Exception("Invalid Id"); } 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 List <Keep> Get() { return(_krepo.Get()); }
public IEnumerable <Keep> Get() { return(_repo.Get()); }
internal IEnumerable <Keep> Get() { return(_repo.Get()); }
public IEnumerable <Keep> Get() //Get All { return(_repo.Get()); }
public IEnumerable <Keep> Get() { return(_kr.Get()); }