My code:
ws.CategoryConfiguration cc = new ws.CategoryConfiguration();
cc.LoadChildProducts = true;
cc.ChildProducts.SearchOptions.PropertiesToReturn = new string[] { "BasePrice" };
when I run this, I get a NullReferenceException on the ChildProducts line. I know that string[] is an object because it's right there, so it must be PropertiesToReturn. Anyone know what the issue is? LoadChildProducts works without any issue.
You need to new up the
SearchOptionsobject, like this:Then you can add the
PropertiesToReturn, like this:Finally, you can assign the
searchOptionsto theCategoryConfiguration.ChildProducts.SearchOptionsproperty, like this: