LLBL Gen Predicate Filter
- by Neil
I am new to LLBLGen Pro and am checking for duplicate, I have the following SQL:
SQL:
select a.TopicId,atc.TopicCategoryId,a.Headline
from article a
inner join ArticleTopicCategory atc on atc.ArticleId = a.Id
where a.TopicId = 'C0064FAE-093B-466E-8745-230534867D2F'
and a.Headline = 'Test'
and atc.TopicCategoryId in ('004D64F7-474C-48F9-9887-17B1E7532A84')
Whenever I step though my function, it always returns 0:
LLBLGen Code:
public bool CheckDuplicateArticle(Guid topicId, List<Guid> categories, string headline)
{
ArticleCollection articles = new ArticleCollection();
PredicateExpression filter = new PredicateExpression();
RelationCollection relation = new RelationCollection();
relation.Add(ArticleEntity.Relations.ArticleTopicCategoryEntityUsingArticleId);
filter.AddWithAnd(ArticleFields.TopicId == topicId);
filter.AddWithAnd(ArticleTopicCategoryFields.Id == categories);
filter.AddWithAnd(ArticleFields.Headline == headline);
articles.GetMulti(filter, 0, null, relation);
return articles.Count > 0;
}
Any help would be appreciated!