SaaS CMS has officially launched! Learn more now.

Nested Convetion not working for extension methods


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 this should work and I can't find anything suggesting otherwise.

Mar 23, 2018 14:27

Have you tried to use ForInstanceOf<WebProduct> instead?

Apr 09, 2018 12:01

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.

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.