Goal: Extend PropertyData and save complex types as JSON (or something else. Doesn't really matter.) in the database and use our own complex types as page properties.
Problem: It seems like EPiServer is ignoring the value in PropertyAgeLimitList and tries to cast IEnumerable<AgeLimit> to String.
public class ActivityPage : SitePageData
{
[BackingType(typeof(PropertyAgeLimitList))] // Our own class which extends PropertyData
[Display(Name = "Age", Description = "Choose an age group.", Order = 500)]
[EditorDescriptor(EditorDescriptorType = typeof(EnumSelectMany<AgeLimit>))] // SelectMany-wrapper
public virtual IEnumerable<AgeLimit> Age { get; set; }
}
This is how we want to use our properties. We don't want to work with strings. We want strongly typed objects as properties.
We've tried setting PropertyValueType to both String and IEnumerable<AgeLimit> and also the get-method of Value. No luck, but everything works when we change the signature og the page property to String instead of IEnumerable<AgeLimit>.
We don't want to create an extra property to parse the page property.
Hi everyone,
Goal: Extend PropertyData and save complex types as JSON (or something else. Doesn't really matter.) in the database and use our own complex types as page properties.
Problem: It seems like EPiServer is ignoring the value in PropertyAgeLimitList and tries to cast IEnumerable<AgeLimit> to String.
This is how we want to use our properties. We don't want to work with strings. We want strongly typed objects as properties.
We've tried setting PropertyValueType to both String and IEnumerable<AgeLimit> and also the get-method of Value. No luck, but everything works when we change the signature og the page property to String instead of IEnumerable<AgeLimit>.
We don't want to create an extra property to parse the page property.
Best Regards,
// Anders & Vidar