I have an interface that describes an specialized list in my application...
Public Interface IAlphabeticListItem
Property StartingLetter() As String
Property DetailsList() As Generic.List(Of DetailsData)
End Interface
Multiple objects implement this interface, but I want to return them in a webservice not as the underlying object, but as the interface.
<WebMethod()> _
Public Function GetCategoryList(...) As Generic.List(Of IAlphabeticListItem)
...
End Function
Sadly, this causes an exception
Cannot serialize interface IAlphabeticListItem.
Exception Details: System.NotSupportedException: Cannot serialize interface IAlphabeticListItem.
Is there a way to make an interface serializable, or am I going to have to convert each of my objects into a concrete class implementing the interface, and then return that class?