In VB.NET how do you specify Inherits/implements on a generic class with multi-constraints
Posted
by Romel Evans
on Stack Overflow
See other posts from Stack Overflow
or by Romel Evans
Published on 2010-06-07T05:47:13Z
Indexed on
2010/06/07
5:52 UTC
Read the original article
Hit count: 363
When I write the following statement in VB.Net (C# is my normal language), I get an "end of statement expected" referring to the "Implements" statement.
<Serializable()> _
<XmlSchemaProvider("EtgSchema")> _
Public Class SerializeableEntity(Of T As {Class, ISerializable, New}) _
Implements IXmlSerializable, ISerializable
...
End Class
The C# version that I'm trying to emulate is:
[Serializable]
[XmlSchemaProvider("MySchema")]
public class SerializableEntity<T> : IXmlSerializable, ISerializable where T : class, new()
{
....
}
Sometimes I feel like I have 5 thumbs with VB.NET :)
© Stack Overflow or respective owner