When I place the code in the same file as the DataAccessAdapter it works. (inside or outside the namespace). When I add to the code a must MustOverride method, and MustInherit to the class. Like this:
Public MustInherit Class TestAdapter
Inherits Ism.Prisma.Collaboration.DatabaseSpecific.DataAccessAdapter
Public Overrides Sub OnBeforeEntitySave(ByVal entityToSave As IEntity2, ByVal isInsert As Boolean)
myOnBeforeEntitySave(entityToSave, isInsert)
MyBase.OnBeforeEntitySave(entityToSave, isInsert)
End Sub
Public MustOverride Sub myOnBeforeEntitySave(ByVal entityToSave As IEntity2, ByVal isInsert As Boolean)
End Class
And try to inherit from that class:
Public Class TestDataAccessAdapter
Inherits TestAdapter
Public Overrides Sub myOnBeforeEntitySave(ByVal entityToSave As SD.LLBLGen.Pro.ORMSupportClasses.IEntity2, ByVal isInsert As Boolean)
End Sub
End Class
I got the following two errors:
_
Error 1 Class 'TestDataAccessAdapter' must either be declared 'MustInherit' or override the following inherited 'MustOverride' member(s):
TestAdapter : Public MustOverride Sub myOnBeforeEntitySave(entityToSave As SD.LLBLGen.Pro.ORMSupportClasses.IEntity2, isInsert As Boolean).
Error 2 sub 'myOnBeforeEntitySave' cannot be declared 'Overrides' because it does not override a sub in a base class.
_
So this does't work
But when i copy the file from my project to the CollaborationDBSpecific project it will work.
Does any one know that this is a bug in .NET??
I try to look at the properties of the CollaborationDBSpecific project and my project they look the same.
O I also tried to override the function OnAfterTransactionCommit, and that works. Only the functions that have parameters I can’t override.
For generation i use the following settings:
Name: Adapter scenario (Full / Safe) Vs.Net 2005
Version: 1.0.2005.1.03032006
Name: VB.NET template set for SqlServer (1.0.2005.1)
Version: 1.0.2005.1.102305
I hope that I gave you enough information. If no one have the same problem or no one can help my, its oke. Then I must use the more ugly method and put my class at the bottom of the DataAccessAdapter file.
Thanks for the support.