This project is read-only.

How to join non contentpart table in projection filter

Topics: Customizing Orchard
Apr 24, 2015 at 2:08 AM

I have a request to join non contentpart table lik:
        SchemaBuilder.CreateTable("DocumentFieldRecord", table => table
            .Column<int>("Id", column => column.PrimaryKey().Identity())
            .Column<int>("ContentItemRecord_Id", column => column.NotNull().Unique())
            .Column<int>("ContentTypeRecord_Id", column => column.NotNull())
            .Column<string>("Title", column => column.NotNull())
            .Column<string>("Number", column => column.Unique())
For context.Query is IHqlQuery it seem can't join non contentpart table.

Apr 27, 2015 at 9:58 AM

I have fixed the problem like ContentFieldsFilter of Orchard.Projection module. Hql like:
            context.Query = context.Query.Where(x => x.ContentPartRecord<DocumentPartRecord>().Property("DocumentFieldRecords", "df"),
                x => x.Like("Title", titleParam, HqlMatchMode.Anywhere));
My DocumentFieldRecords has a table field:Title.

Thanks! Best Regards!
Marked as answer by ezrachen on 4/27/2015 at 1:59 AM