public bool Demote(DateTime at, IUser byUser) { Check.Argument.IsNotNull(byUser, "byUser"); if (CanDemote(byUser)) { var vote = this.GetVote(byUser); this.RemoveVote(vote); StoryVotesInternal.Remove((StoryVote)vote); LastActivityAt = at; return(true); } return(false); }
public bool Promote(DateTime at, IUser byUser, string fromIpAddress) { Check.Argument.IsNotNull(byUser, "byUser"); //Check if user can promote if (CanPromote(byUser)) { //Call extension method AddVote, it will perform all parameters validation checks var vote = this.AddVote(at, byUser, fromIpAddress); //Add created vote to StoryVotes, this should increment votes StoryVotesInternal.Add((StoryVote)vote); LastActivityAt = at; return(true); } return(false); }