Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.
Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.
Earlier versions you needed this base class, but you no longer do. You can delete it. Now you can simply do:
[PropertyDefinitionTypePlugIn] public class LocationsProperty : PropertyList<Location> { }
You can read more details about the updated propertylist here
...and if you use it on a POCO class that has urls remember to decorate that field with to avoid serialization errors (url wont be saved correctly)
[JsonProperty]
[JsonConverter(typeof(UrlConverter))]
[Display(Name = "Favorite", Order = 200)]
public virtual Url FavoriteLink { get; set; }
On updating Episerver core to the latest version v11.13.0.0, the ParseToObject method in the PropertyList<T> class is removed. Kindly suggest an alternate for this method.
Thanks in advance.
public class PropertyListBase<T> : PropertyList<T>
{
public PropertyListBase()
{
objectSerializer = this.objectSerializerFactory.Service.GetSerializer("application/json");
}
private Injected<ObjectSerializerFactory> objectSerializerFactory;
private IObjectSerializer objectSerializer;
protected override T ParseItem(string value)
{
return objectSerializer.Deserialize<T>(value);
}
public override PropertyData ParseToObject(string value)
{
ParseToSelf(value);
return this;
}
}