November Happy Hour will be moved to Thursday December 5th.

Nested Convetion not working for extension methods

Vote:
 

Hi, I have an extension method that returns an list of object with properies that I want to be able to filter and sort on.

clientConventions.ForInstancesOf().IncludeField(document => document.FindVariations());
clientConventions.NestedConventions.ForType().Add(document => document.FindVariations());

But when I try to filter or sort on the extension method I get an error saying that the it isn't a nested object. And if I look in the index I can see that the property is missing the $$nested sufix.

"FindVariations": [
        {
            "$type": "Avensia.Storefront.Starter.Infrastructure.Find.Models.FindWebVariation, Avensia.Storefront.Starter",
}

Thi problem only seems to happen when its an extension method.

According to https://world.episerver.com/documentation/developer-guides/find/NET-Client-API/searching/nested-queries/ this should work and I can't find anything suggesting otherwise.

#189745
Mar 23, 2018 14:27
Vote:
 

Have you tried to use ForInstanceOf<WebProduct> instead?

#190317
Apr 09, 2018 12:01
Vote:
 

I added FindVariations => this.FindVariations() to WebProduct and made a NestadConvention for that to make it work, but this nevet sat right with mer.

Thanks for the help.

#190320
Edited, Apr 09, 2018 13:24
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.