Backstory: Our method provider calls a collection of his 'Modulvariablen' a 'Modul'. The german plural of 'Modul' is 'Module'. Because we want to keep as close as possible to his naming schema this means a bit of trouble in Visual Basic, because 'Module' is also a language keyword. But you can work around that with using '[Module]' instead.
The ObjectContext template actually does this fine for the property declaration, but it then keeps using the name '[Module]' also everywhere else and so creates incorrect code.
Example of generated code:
Code: Select all
'''
''' Gibt die Module zurück oder setzt diese.
'''
Public ReadOnly Property [Module]() As ObjectSet(Of Modul)
Get
If (_[Module] Is Nothing) Then
_[Module] = MyBase.CreateObjectSet(Of Modul)("Module")
End If
Return _[Module]
End Get
End Property
Private _[Module] As ObjectSet(Of Modul)
'''
''' Deprecated Method for adding a new object to the [Module] EntitySet.
'''
Public Sub AddTo[Module](modul As Modul)
MyBase.AddObject("Module", modul)
End Sub
The correct code should look like this:
Code: Select all
'''
''' Gibt die Module zurück oder setzt diese.
'''
Public ReadOnly Property [Module]() As ObjectSet(Of Modul)
Get
If (_Module Is Nothing) Then
_Module = MyBase.CreateObjectSet(Of Modul)("Module")
End If
Return _Module
End Get
End Property
Private _Module As ObjectSet(Of Modul)
'''
''' Deprecated Method for adding a new object to the [Module] EntitySet.
'''
Public Sub AddToModule(modul As Modul)
MyBase.AddObject("Module", modul)
End Sub