public class ActionTag { public string Tag { get; set; } }
[PropertyDefinitionTypePlugIn] public class ActionTagProperty : PropertyList { }
[Display(Name = "Action Tags",
Order = 10)] [EditorDescriptor(EditorDescriptorType = typeof(CollectionEditorDescriptor))] [BackingType(typeof(ActionTagProperty))] public virtual IList ActionTags { get; set; }
service API : GET /episerverapi/commerce/entries/{Code} results in
{"Name":"ActionTags","Type":"LongString","Data":[{"Language":"en-GB","Value":"System.Collections.ObjectModel.ReadOnlyCollection`1[EpiWebsite.Models.Commerce.PropertyType.ActionTag]"},{"Language":"de","Value":"System.Collections.ObjectModel.ReadOnlyCollection`1[EpiWebsite.Models.Commerce.PropertyType.ActionTag]"},{"Language":"de-AT","Value":"System.Collections.ObjectModel.ReadOnlyCollection`1[EpiWebsite.Models.Commerce.PropertyType.ActionTag]"},{"Language":"de-CH","Value":"System.Collections.ObjectModel.ReadOnlyCollection`1[EpiWebsite.Models.Commerce.PropertyType.ActionTag]"},{"Language":"de-LU","Value":"System.Collections.ObjectModel.ReadOnlyCollection`1[EpiWebsite.Models.Commerce.PropertyType.ActionTag]"},{"Language":"fr","Value":"System.Collections.ObjectModel.ReadOnlyCollection`1[EpiWebsite.Models.Commerce.PropertyType.ActionTag]"},{"Language":"fr-BE","Value":"System.Collections.ObjectModel.ReadOnlyCollection`1[EpiWebsite.Models.Commerce.PropertyType.ActionTag]"},{"Language":"fr-CH","Value":"System.Collections.ObjectModel.ReadOnlyCollection`1[EpiWebsite.Models.Commerce.PropertyType.ActionTag]"},{"Language":"fr-LU","Value":"System.Collections.ObjectModel.ReadOnlyCollection`1[EpiWebsite.Models.Commerce.PropertyType.ActionTag]"},{"Language":"nl","Value":"System.Collections.ObjectModel.ReadOnlyCollection`1[EpiWebsite.Models.Commerce.PropertyType.ActionTag]"},{"Language":"nl-BE","Value":"System.Collections.ObjectModel.ReadOnlyCollection`1[EpiWebsite.Models.Commerce.PropertyType.ActionTag]"}]},
service api : POST /episerverapi/commerce/entries" results in exception
EPiServer.Core.InvalidPropertyValueException: "[]" is not a valid value for "ActionTag". --->
System.ArgumentException: Property value must implement IList or IEnumerable.Parameter name: value
It is supposed to continue working - we will look into this ASAP. Thanks for bringing this into our attention
The problem will be addressed in ServiceAPI 5.0.1
public class ActionTag
{
public string Tag { get; set; }
}
[PropertyDefinitionTypePlugIn]
public class ActionTagProperty : PropertyList
{
}
[Display(Name = "Action Tags",
Order = 10)]
[EditorDescriptor(EditorDescriptorType = typeof(CollectionEditorDescriptor))]
[BackingType(typeof(ActionTagProperty))]
public virtual IList ActionTags { get; set; }
service API : GET /episerverapi/commerce/entries/{Code} results in
{"Name":"ActionTags","Type":"LongString","Data":[{"Language":"en-GB","Value":"System.Collections.ObjectModel.ReadOnlyCollection`1[EpiWebsite.Models.Commerce.PropertyType.ActionTag]"},{"Language":"de","Value":"System.Collections.ObjectModel.ReadOnlyCollection`1[EpiWebsite.Models.Commerce.PropertyType.ActionTag]"},{"Language":"de-AT","Value":"System.Collections.ObjectModel.ReadOnlyCollection`1[EpiWebsite.Models.Commerce.PropertyType.ActionTag]"},{"Language":"de-CH","Value":"System.Collections.ObjectModel.ReadOnlyCollection`1[EpiWebsite.Models.Commerce.PropertyType.ActionTag]"},{"Language":"de-LU","Value":"System.Collections.ObjectModel.ReadOnlyCollection`1[EpiWebsite.Models.Commerce.PropertyType.ActionTag]"},{"Language":"fr","Value":"System.Collections.ObjectModel.ReadOnlyCollection`1[EpiWebsite.Models.Commerce.PropertyType.ActionTag]"},{"Language":"fr-BE","Value":"System.Collections.ObjectModel.ReadOnlyCollection`1[EpiWebsite.Models.Commerce.PropertyType.ActionTag]"},{"Language":"fr-CH","Value":"System.Collections.ObjectModel.ReadOnlyCollection`1[EpiWebsite.Models.Commerce.PropertyType.ActionTag]"},{"Language":"fr-LU","Value":"System.Collections.ObjectModel.ReadOnlyCollection`1[EpiWebsite.Models.Commerce.PropertyType.ActionTag]"},{"Language":"nl","Value":"System.Collections.ObjectModel.ReadOnlyCollection`1[EpiWebsite.Models.Commerce.PropertyType.ActionTag]"},{"Language":"nl-BE","Value":"System.Collections.ObjectModel.ReadOnlyCollection`1[EpiWebsite.Models.Commerce.PropertyType.ActionTag]"}]},
service api : POST /episerverapi/commerce/entries" results in exception
EPiServer.Core.InvalidPropertyValueException: "[]" is not a valid value for "ActionTag". --->
System.ArgumentException: Property value must implement IList or IEnumerable.
Parameter name: value