Example #1
0
        public override double Calculate(DateTime publishingTimestamp, IStory story)
        {
            Check.Argument.IsNotNull(story, "story");

            IKnownSource     knownSource = _repository.FindMatching(story.Url);
            KnownSourceGrade grade       = (knownSource == null) ? KnownSourceGrade.None : knownSource.Grade;

            return((int)grade);
        }
Example #2
0
        public void Add(IKnownSource entity)
        {
            Check.Argument.IsNotNull(entity, "entity");

            KnownSource knownSource = (KnownSource)entity;

            if (_context.KnownSources.Any(ks => ks.Url == knownSource.Url))
            {
                throw new ArgumentException("\"{0}\" source already exits. Specifiy a diffrent url.".FormatWith(knownSource.Url), "entity");
            }

            base.Add(knownSource);
        }
Example #3
0
 public void Remove(IKnownSource entity)
 {
     base.Remove((KnownSource)entity);
 }