I have the following LLBLGen code that retrieves articles by Category. Essentially it is selecting from the article table where the articles are not marked for deletion and joining on the ArticleTopicCategory table to retrieve specific categories (where category = 'string')
ArticleCollection articles = new ArticleCollection();
IPredicateExpression articlesFilter = new PredicateExpression();
articlesFilter.Add(ArticleFields.IsFlaggedForDeletion != true);
PrefetchPath prefetchTopic = new PrefetchPath(EntityType.ArticleEntity);
prefetchTopic.Add(ArticleEntity.PrefetchPathTopic);
prefetchTopic.Add(ArticleEntity.PrefetchPathArticleTopicCategories).SubPath.Add(ArticleTopicCategoryEntity.PrefetchPathTopicCategory);
articles.GetMulti(articlesFilter, prefetchTopic);
I have added another table named SuppressedArticle which is a 1 to many and contains Id, OrganizationId, and ArticleId. The theory is that since articles are syndicated to multiple websites, if "Website A" did not want to publish "Article A" they could suppress it, i.e insert a record into the SuppressedArticle table.
On the article admin screen, i'd like to add a link button to suppress/unsuppress the article, by adding a left join with the two conditions like:
left join SuppressedArticle on (Article.Id = SuppressedArticle.articleId and SuppressedArticle.organizationId='CC177558-85CC-45CC-B4E6-805BDD1EECCC')
I tried adding the multiple join like so, but I cast/conversion error:
"Cannot implicitly convert type 'SD.LLBLGen.Pro.ORMSupportClasses.FieldCompareValuePredicate' to 'SD.LLBLGen.Pro.ORMSupportClasses.IPredicateExpression'. An explicit conversion exists (are you missing a cast?)"
IRelationCollection relations = new RelationCollection();
relations.Add(ArticleEntity.Relations.SuppressedArticleEntityUsingArticleId, JoinHint.Left).CustomFilter = new FieldCompareValuePredicate(SuppressedArticleFields.OrganizationId, ComparisonOperator.Equal, this.CurrentIdentity.OrganizationId);
Any help would be greatly appreciated!