Пример #1
0
        public virtual bool MarkAsSpam(DateTime at, IUser byUser, string fromIPAddress)
        {
            Check.Argument.IsNotInFuture(at, "at");
            Check.Argument.IsNotNull(byUser, "byUser");
            Check.Argument.IsNotEmpty(fromIPAddress, "fromIPAddress");

            if (CanMarkAsSpam(byUser))
            {
                StoryMarkAsSpam markAsSpam = new StoryMarkAsSpam
                {
                    Story     = this,
                    User      = (User)byUser,
                    IPAddress = fromIPAddress,
                    Timestamp = at
                };

                StoryMarkAsSpams.Add(markAsSpam);
                IoC.Resolve <IMarkAsSpamRepository>().Add(markAsSpam);

                LastActivityAt = at;

                return(true);
            }

            return(false);
        }
Пример #2
0
        public bool MarkAsSpam(DateTime at, IUser byUser, string fromIpAddress)
        {
            Check.Argument.IsNotInFuture(at, "at");
            Check.Argument.IsNotNull(byUser, "byUser");
            Check.Argument.IsNotEmpty(fromIpAddress, "fromIpAddress");

            if (CanMarkAsSpam(byUser))
            {
                var spamStory = this.MarkSpam(at, byUser, fromIpAddress);
                StoryMarkAsSpams.Add((StoryMarkAsSpam)spamStory);

                LastActivityAt = at;

                return(true);
            }

            return(false);
        }