Esempio n. 1
0
        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");
        }
Esempio n. 2
0
 public void Keep(int KeepId)
 {
     _repo.AddKeep(KeepId);
 }