Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Get all the values for PropertyDictionaryMultiple

Vote:
0

Hi,

I have a property like:

 [BackingType(typeof(PropertyDictionaryMultiple))]

public virtual ItemCollection Prop1 { get; set; }

And I need to extract all the posible values for it.  Is there any api to call to get such data?

#190515
Apr 11, 2018 15:16
Vote:
1

Yes there is. However you have to know the MetaField mapped to that property. Then you can do it like this:

var metaField = MetaField.Load(CatalogContext.MetaDataContext, metaFieldId).Dictionary.OfType<MetaDictionaryItem>();

#190526
Edited, Apr 11, 2018 15:52
Vote:
0

Maybe I use wrong libraries, but it says that:

OfType<MetaDictionaryItem>();

is not supported.

using Mediachase.Commerce.Catalog;
using Mediachase.MetaDataPlus.Configurator;
#190541
Edited, Apr 11, 2018 17:34
Vote:
1

My bad, missed ".Dictionary" part. 

#190542
Apr 11, 2018 17:38
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.