internal Keep Edit(Keep keepToUpdate) { Keep original = Get(keepToUpdate.Id); if (keepToUpdate.UserId == original.UserId) { original.Name = keepToUpdate.Name.Length > 0 ? keepToUpdate.Name : original.Name; original.Description = keepToUpdate.Description.Length > 0 ? keepToUpdate.Description : original.Description; original.IsPrivate = keepToUpdate.IsPrivate; original.Keeps = keepToUpdate.Keeps > 0 ? keepToUpdate.Keeps : original.Keeps; original.Shares = keepToUpdate.Shares > 0 ? keepToUpdate.Shares : original.Shares; original.Views = keepToUpdate.Views > 0 ? keepToUpdate.Views : original.Views; return(_repo.EditAll(original)); } else { original.Keeps = keepToUpdate.Keeps > 0 ? keepToUpdate.Keeps : original.Keeps; original.Shares = keepToUpdate.Shares > 0 ? keepToUpdate.Shares : original.Shares; original.Views = keepToUpdate.Views > 0 ? keepToUpdate.Views : original.Views; return(_repo.Edit(original)); } }