Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Get all the values for PropertyDictionaryMultiple

Vote:
 

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:
 

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:
 

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:
 

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.