I have a page which has IList<Fruit> property in CMS. My fruit class has Benefit property. User can add Benefits from the same page in different tabs and those saved benefits are displayed in dropdown of the page. So, I used ISelectionFactory with SelectMany and tried to retrieve the saved benefits to dropdown. But metadata.FindOwnerContent() is giving null in GetSelections method of ISelectionFactory. This does not happen when I use Benefit property directly on the page. I need to identify page, to retrieve the saved benefits so that I can assign one of them to fruit.
Page has Ilist<fruit> and blocks of benefits.Fruit class has Benefit property.
I want to map fruits with benefits and benefits itself is created in this page as block type. I could not find page reference or content link id to retrieve benefits in this case.
Can you show us some code?
Please follow below blog post if it help
As I understook the you are needing to get owner content (page or block) from Selection Factory for Benefit propery when this property belongs to IList<Fruit> property.
I hope this code will help in your situation
As far as I'm aware, you can't get the owner content from a selection factory (or an attribute) inside an IList<T> property (I've tried various methods). By the looks of it there will be a fix in Epi 12 though I realise that's probably not much consolation right now: