public void SaveMatchCirterion(RssFeedMatchCriterion criterion) { using (var ctx = new RssContext()) { AddOrUpdate(criterion, ctx); ctx.SaveChanges(); } }
private bool FieldMatches(string fieldValue, RssFeedMatchCriterion matchCriterion) { return(fieldValue?.IndexOf(matchCriterion.ExactContains, StringComparison.InvariantCultureIgnoreCase) >= 0); }
private bool PostMatches(RssPost post, RssFeedMatchCriterion matchCriterion) { return(FieldMatches(post.Content, matchCriterion) || FieldMatches(post.Title, matchCriterion) || FieldMatches(post.Description, matchCriterion)); }