by populating i mean addind them to the system so that they are choosable on variants :)
Hi,
StringDictionary is not supported by strongly typed content type currently. Gatis made a custom implementation here: http://world.episerver.com/forum/developer-forum/EPiServer-Commerce/Thread-Container/2014/7/MetaDataTypeStringDictionary-from-code/ - I did not try it and I don't know if it works as you wanted, but you can try it yourself.
Regards.
/Q
Thanks Quan, i found that one but was hoping there was a easier way to solve this today.. :)
Quan is there a way to add MetaDataType.EnumMultiValue from code?
like for this one:
[Display(Name = "my special property", GroupName = GroupNames.Categoriestab, ,Order = 1400)]
[BackingType(typeof(PropertyDictionaryMultiple))]
public override ItemCollection<string> AccessProperties { get; set; }
You should be able to use the property itself as it maps to EnumMultiValue
AccessProperties.Add(value);
thanks all for your help :)
using Get and Store from MetaDictionaryItemStore solved my issue
this solved my issue:
MetaDictionaryItemStore newItemStore = ServiceLocator.Current.GetInstance<MetaDictionaryItemStore>();
var allItems = (IEnumerable<MetaDictionaryItemModel>)newItemStore.Get(parentCategoryId, new ItemRange()).Data;
if (!allItems.Where(s => s.DefaultValue.Equals(name)).Any())
{
var newModel = new MetaDictionaryItemModel();
newModel.DefaultValue = name;
newModel.IsInUse = true;
newModel.OwnerMetaFieldId = parentCategoryId;
newModel.Value = name;
newItemStore.Post(newModel);
}
Hi
i have added new property of type PropertyDictionaryMultiple and now i need to add 500 choosable items to it and really dont want to do it manually..
[Display(Name = "my special property", GroupName = GroupNames.Categoriestab, ,Order = 1400)] AccessProperties { get; set; }
[BackingType(typeof(PropertyDictionaryMultiple))]
public override ItemCollection
is there a way to populate them from code?
Regards
Pawel