Well, that was a pretty silly post.. Forgot that this is on a Product so is the Commerce content provider which won't have compatibility for things like PropertyList! Oops, I'll leave this here for future me in case I do the same thing again :)
If you add the attribute
[BackingType(typeof(PropertyContentReferenceList))]
To your property it will work. All the ILists work as long as you set the correct backing types so that commerce knows the correct meta data field to map to
Commerce contents have full support for IList<T> - well, except for inside blocks (which is coming soon). However you need to specify a BackingType as Scott said
Oh, in that case I’ll give that a try. I often run into weird limitations with Commerce content so just assumed this was another. Thanks Scott and Quan for the replies!
Just follow up message to say Scott and Quan were right :)
My property as follows works well:
[BackingType(typeof(PropertyContentReferenceList))]
[Display(
Name = "Media files",
GroupName = SystemTabNames.Content,
Order = 130)]
[AllowedTypes(typeof(MediaData))]
public virtual IList<ContentReference> MediaFiles { get; set; }
Thanks again.
I'm trying to use a very simple ContentReferenceList like this:
But I am getting the exception:
System.NotSupportedException: The type System.Collections.Generic.IList`1[[EPiServer.Core.ContentReference, EPiServer, Version=11.9.3.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7]] can not be mapped to a MetaDataType
Seems like this should be simple - so hopefully I've missed something obvious?
[I'm using Episerver CMS v11.9.3]