If I'm extending OnCreated for a LINQ to SQL table object, is it possible to get a reference to the data context to which the table belongs? For example, if I add a property to the data context:
Partial Class MyDataContext
Private _myValue As String
Public ReadOnly Property MyValue As String
Get
Return _myValue
End Get
Set(ByVal value As String)
_myValue = value
End Set
End Property
End Class
is there any way to access that value in the create event of the table, i.e.:
Partial Class MyTable
Private Sub OnCreated()
Dim contextValue = [data_context_reference_here].MyValue
End Sub
End Class
I don't want the property on the data context to be Shared, because it could be different per instance. I've been pouring over the designer code to figure out where the reference might be, but no luck yet. Any ideas?