Applying Extension method to generic class with generic type

后端 未结 1 736
刺人心
刺人心 2021-02-08 10:43

I was working with the generic class in vb.net.
And it seems extension method cannot be applied to generic class without specifying the type.

I have this generic cla

1条回答
  •  日久生厌
    2021-02-08 11:22

    If you make your extension method a generic method it should work

    i.e DoSomething (Of T) () instread of just DoSomething()

     _
    Public Sub DoSomething(Of T)(ByVal myGenericObj As MyGeneric(Of T))
    End Sub
    

    Hope this helps

    0 讨论(0)
提交回复
热议问题