Reputation: 359
Can an Interface contain an Enum?
I am using asp.net 2.0. Suddenly my code started having problems when I added an enum to the interface below. In it, LookUpType is an enum.
Public Interface ILookup
Property ID() As Int32
Property Text() As String
Property Description() As String
Property Status() As Status
Property OrderID() As Int32
ReadOnly Property LookUpType() As LookUpType
End Interface
Upvotes: 2
Views: 4490
Reputation: 754715
You're question is a bit ambigious, it sounds like you could be asking either of the following
Yes. Enum's are not special in any way that prevents them being a return type on an interface
Yes, this is completely legal in VB.Net. It is however not legal in C#
Interface IFoo
Enum E1
V1
End Enum
Function SomeMethod() As E1
End Interface
Upvotes: 15