Information générale
Catégorie:
The Mere Mortals .NET Framework
Titre:
Casting from an interface to mmBusinessObjectGeneric
I’m working on some base classes in there own project that need to access the entity object in mmBusinessObjectGeneric
In these base classes the business object “DataCapReturn” implements an interface IdataCapReturn. The interface has the methods and properties needed.
I have another interface IdataCapReturnEntity that has the common data properties that I need to access. This interface is implemented by the DataCapReturnEntity.
Where I’m running into trouble is casting from the interface to mmBusinessObjectGeneric
Example code.
Dim mmReturnData As mmBusinessObjectGeneric(Of mmBusinessEntity) = CType(Me.oReturnData, mmBusinessObjectGeneric(Of mmBusinessEntity))
Dim oEntity As IdataCaptureReturnEntity = CType(mmReturnData.Entity, IdataCaptureReturnEntity)
This throws a casting execption
How can I cast from the interface to mmBusinessObjectGeneric?
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement