K
kenneth.choe
(Any help would be very much appreciated.)
I have a base class QueryBase, to implement generalization.
MustInherit Class QueryBase
Public MustOverride Function GetData(ByVal dataSetType As
DataSetTypeBase) As DataSet
End Class
Enum DataSetTypeBase As Integer
IdentifierOnly = 1
FullSet = 2
End Enum
And, I have CustomerQuery, which inherits from QueryBase.
Class CustomerQuery
Inherits QueryBase
Public Overrides Function GetData(ByVal dataSetType As
DataSetTypeBase) As System.Data.DataSet
End Function
End Class
Public Enum CustomerDataSetType As Integer
IdentifierOnly = 1
FullSet = 2
FullSetWithPurchaseProfiling = 3 ' additional data set type
End Enum
As you can see, I want to add one more DataSetType on CustomerQuery.
Other inheriting queries may have their own data set type, too.
Now, I see Overrides does not let me use CustomerDataSetType instead
of DataSetTypeBase. Overrides requires exactly same signature and does
not allow widening or any.
I cannot make CustomerDataSetType to inherit from DataSetTypeBase
either, because it is not a class but just a enum, and you cannot
inherit enum. (I used Enum to have intellisense provide possible
values. I don't know if there is a way to do this with class.)
Do you have any suggestions how to implement this nicely?
Thank you.
I have a base class QueryBase, to implement generalization.
MustInherit Class QueryBase
Public MustOverride Function GetData(ByVal dataSetType As
DataSetTypeBase) As DataSet
End Class
Enum DataSetTypeBase As Integer
IdentifierOnly = 1
FullSet = 2
End Enum
And, I have CustomerQuery, which inherits from QueryBase.
Class CustomerQuery
Inherits QueryBase
Public Overrides Function GetData(ByVal dataSetType As
DataSetTypeBase) As System.Data.DataSet
End Function
End Class
Public Enum CustomerDataSetType As Integer
IdentifierOnly = 1
FullSet = 2
FullSetWithPurchaseProfiling = 3 ' additional data set type
End Enum
As you can see, I want to add one more DataSetType on CustomerQuery.
Other inheriting queries may have their own data set type, too.
Now, I see Overrides does not let me use CustomerDataSetType instead
of DataSetTypeBase. Overrides requires exactly same signature and does
not allow widening or any.
I cannot make CustomerDataSetType to inherit from DataSetTypeBase
either, because it is not a class but just a enum, and you cannot
inherit enum. (I used Enum to have intellisense provide possible
values. I don't know if there is a way to do this with class.)
Do you have any suggestions how to implement this nicely?
Thank you.