internal Keep Edit(Keep keepToUpdate, string userId) { Keep foundKeep = GetOne(keepToUpdate.Id); if (keepToUpdate.Keeps == 1) { if (_repo.AddKeep(keepToUpdate)) { foundKeep.Keeps++; return(foundKeep); } } if (keepToUpdate.Views == 1) { if (_repo.AddView(keepToUpdate)) { foundKeep.Views++; return(foundKeep); } } if (keepToUpdate.Shares == 1) { if (_repo.AddShare(keepToUpdate)) { foundKeep.Shares++; return(foundKeep); } } throw new Exception("error on edit keep"); }
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); }