I'm trying to use the DefaultValue attribute to decorate a property in order to assert the value is defaulted as a new list of a typed object in the program. The failing code is as follows:
<DataContract()>
Partial Public Class MessageBaseResponse
#Region "Properties"
<DataMember()>
Public Property Header As Header
<DataMember()>
<DefaultValue(GetType(List(Of [Error])))>
Public Property Errors As List(Of [Error])
<DataMember()>
<DefaultValue(GetType(List(Of Warning)))>
Public Property Warnings As List(Of Warning)
#End Region
End Class
How to instantiate new lists as default property value using the DefaultValue attribute approach?