Type argument error from inherited interface?
I'm getting a "Type argument 'T' does not inherent from or implement the constraint type" error on my IAccessType interface but I don't understand why. How would one create a generic parameterized interface to handle other generic parameterized interface? I want to make Access interfaces that contain a factory method for creating Dtos which in turn contains a factory method for creating Entities when saving them to a data base by repertoires some of which are specific to Entity types.
Code:
Namespace Entites
Public Interface IGenericEnt
End Interface
Public Interface IEntityType : Inherits IGenericEnt
End Interface
End Namespace
Namespace Dto
Public Interface IGenericDto(Of T As Entites.IGenericEnt)
End Interface
Public Interface IDtoType(Of T As Entites.IEntityType) : Inherits IGenericDto(Of T)
End Interface
End Namespace
Namespace DbAccess
Public Interface IGenericAccess(Of T As Dto.IGenericDto(Of Entites.IGenericEnt))
End Interface
Public Interface IAccessType(Of T As Dto.IDtoType(Of Entites.IEntityType)) : Inherits IGenericAccess(Of T)
End Interface
End Namespace
Easy enough to do this without having generic types for everything but I wanted to experiment with coupling everything together like this, but I'm more interested in why this is not valid then anything. Also, I think I am also not 100% clear on how and where to use generic type interfaces and what the syntax actually means.
Like is there a difference between
Code:
Public Interface IDtoType(Of T As Entites.IEntityType) : Inherits IGenericDto(Of T)
And
Code:
Public Interface IDtoType : Inherits IGenericDto(Of Entites.IEntityType)