I defined the following extension of the Date? data type
'Nullable Date Extensions
<System.Runtime.CompilerServices.Extension()> _
Public Function ToObject(ByVal thisInstance As Date?) As Object
Return If(thisInstance.HasValue, CType(thisInstance, Object), DBNull.Value)
End Function
Which gave me the terse capability to do this:
Public Property MyDateTime() As Date?
rowTest.Item("MyDate") = Me.MyDate.ToObject
But when I moved my compiler definition to a separate DLL, I the ToObject method was no longer available from my project even though I had referenced the Class project which now contained the extension.
Is this a limitation of the Compiler Extensions? HOw do you get reusability out of them?