Projector HQL query: where clause with record's property's property?

Topics: Writing modules
Developer
Jun 21, 2012 at 9:50 PM
Edited Jun 22, 2012 at 2:22 PM

I'd like to filter content items on their creation month. This is stored in CommonPartRecord.CreatedUtc.Value.Month. Is there a way to filter on that?

Using the following doesn't work:

context.Query.Where(a => a.ContentPartRecord<CommonPartRecord>(), p => p.Le("CreatedUtc.Value.Month", value));

This will be inefficient I guess (if it's possible), but if there are several steps of filtering before it (so practically till we get to this filtering there won't be more than a handful of items) maybe this won't cause an issue? Or running the query doesn't happen like this...

Thanks in advance!