我是 LLBLGen Pro 的新手,正在检查重复项,我有以下 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')
每当我通过我的函数时,它总是返回 0:
LLBLGen 代码:
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;
}
任何帮助,将不胜感激!