internal Keep GetById(string creatorId, int id) { Keep original = _repo.GetById(id); if (original == null) { throw new Exception("Invalid ID"); } return(original); }
public Keep Get(int id) { var found = _repo.GetById(id); if (found.IsPrivate == true) { throw new Exception("Thats private yo"); } return(found); }
public Keep GetById(int id) { var data = _krepo.GetById(id); if (data == null) { throw new Exception("Invalid Id"); } return(data); }
internal Keep GetById(int id) { Keep keepData = _repo.GetById(id); if (keepData == null) { throw new Exception("Invalid Id"); } return(keepData); }
public Keep GetById(int id) { Keep foundKeep = _repo.GetById(id); if (foundKeep == null) { throw new Exception("Invalid Id"); } return(foundKeep); }
private Keep Get(int id) { Keep exists = _repo.GetById(id); if (exists == null) { throw new Exception("Invalid Keep Id"); } return(exists); }
internal Keep GetById(int id) { var existenceTest = _repo.GetById(id); if (existenceTest == null) { throw new Exception("Bad Id"); } return(existenceTest); }
internal Keep GetById(int id) { var exists = _repo.GetById(id); if (exists == null) { throw new Exception("Invalid ID"); } return(exists); }
internal Keep GetPublicKeepById(int id) { var found = _repo.GetById(id); if (found == null) { throw new Exception("Invalid Id"); } return(_repo.GetPublicKeepById(id)); }
internal Keep GetById(int keepId) { var data = _repo.GetById(keepId); if (data == null) { throw new Exception("Invalid Id... from keepsService"); } return(data); }
internal ViewModelKeep GetById(string profileId, int keepId) { _repo.AddView(keepId); ViewModelKeep original = _repo.GetById(keepId); if (original == null) { throw new Exception("Invalid Id"); } return(original); }
internal Keep GetById(int id) { Keep found = _repo.GetById(id); found.Views = found.Views + 1; _repo.Edit(found); if (found == null) { throw new Exception("Invalid Id"); } return(found); }
internal object GetById(int id, string userId) { Keep exists = _repo.GetById(id, userId); if (exists == null) { throw new Exception("Invalid Id"); } // I don't know why this threw an error when the delete didn't (maybe it created it's own?)... oh wait, I don't want thsi logic. Duh. Ppl should be able to see the public posts of others by Id. // if (exists.UserId != userId) { throw new Exception("Cannot get things you did not create"); } return(exists); }
internal Keep GetById(int id) { var exists = _repo.GetById(id); if (exists == null) { throw new Exception("Invalid Id"); } exists.Views++; _repo.Edit(exists); return(exists); }
internal Keep GetById(int id) { Keep data = _repo.GetById(id); if (data == null) { throw new Exception("Invalid Id"); } data.Views++; Keep incremented = _repo.Edit(data); return(incremented); }
internal Keep GetById(int keepId, string userId) { var exists = _repo.GetById(keepId); if (exists == null) { throw new Exception("Invalid Id"); } else if (exists.IsPrivate == true && exists.UserId != userId) { throw new Exception("You can't access this"); } return(exists); }
public Keep GetById(int id, string userId) { var exists = _repo.GetById(id); if (exists == null) { throw new Exception("Invalid ID"); } if (exists.IsPrivate == true && userId != exists.UserId) { throw new Exception("Cannot accesss. This keep is private."); } return(exists); }
internal Keep GetById(int id) { var exists = _repo.GetById(id); if (exists == null) { throw new Exception("Invalid id."); } if (exists.IsPrivate == false) { return(exists); } throw new Exception("Can't access private content."); }
internal Keep GetById(int id, string userId) { var found = _repo.GetById(id); if (found == null) { throw new Exception("Invalid id"); } else if (found.IsPrivate != true && found.UserId != userId) { throw new Exception("you are not the user"); } return(found); }
internal Keep GetById(int id, string userId) { var exists = _repo.GetById(id); if (exists == null) { throw new Exception("Invalid ID"); } if (exists.IsPrivate == true && exists.UserId != userId) { throw new Exception("This post is private and cannot be viewed"); } return(exists); }
internal Keep GetById(int id) { var exists = _repo.GetById(id); if (exists == null) { throw new Exception("Invalid Id, or private"); } else if (exists.IsPrivate == true) { throw new Exception("This keep is Private"); } return(exists); }
internal Keep GetById(int id, string userId) { var found = _repo.GetById(id); if (found == null) { throw new Exception("Invalid id"); } // if found.isPrivate is true and userId doesn't match found.UserId, throw error if (found.IsPrivate && userId != found.UserId) { throw new Exception("Must be logged in to see private keeps"); } return(found); }
public Keep GetById(int id) { Keep foundKeep = _repo.GetById(id); if (foundKeep.IsPrivate) { throw new Exception("Invalid Keep Id/Not Public."); } return(foundKeep); }
public Keep GetById(string userId, int id) { Keep foundKeep = _repo.GetById(id); if (foundKeep.IsPrivate) { Keep foundPrivateKeep = _repo.GetPrivateById(userId, id); if (foundPrivateKeep == null) { throw new Exception("Invalid User"); } return(foundPrivateKeep); } if (foundKeep == null) { throw new Exception("Invalid Keep Id"); } return(foundKeep); }
internal Keep GetById(int id) { Keep data = _keepsRepo.GetById(id); if (data == null) { throw new Exception("Invalid Id"); } return(data); }
public Keep Create(Keep newKeep) { newKeep.Views = 0; newKeep.Keeps = 0; newKeep.Shares = 0; int newId = _repo.Create(newKeep); return(_repo.GetById(newId)); }
//passses an id to repo to return a single keep internal Keep 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); }
public Keep GetById(int id) { Keep foundKeep = _repo.GetById(id); if (foundKeep == null) { throw new Exception("No Keep found under that id."); } return(foundKeep); }
internal Keep GetById(int id) //Get by Id { Keep foundKeep = _repo.GetById(id); if (foundKeep == null) { throw new Exception("Invalid Id"); } return(foundKeep); }
public Keep GetById(int id, string userId) { Keep k = _repo.GetById(id, userId); if (k == null) { throw new Exception("Can't get that keep."); } return(k); }