I am sure I am missing something simple. I am implementing a ReadOnlyBase-derived business object:
Public Function GetBranchGLCache(ByVal cacheID As Guid) As BranchGLCache
Return CType(DataPortal.Fetch(New SingleCriteria(Of BranchGLCache, Guid) _
(cacheID)), BranchGLCache)
End Function
Private Overloads Sub DataPortal_Fetch(ByVal branchGLCache As
_ DAL.BranchGLTransactionSummaryCache)
If Not (branchGLCache Is Nothing) Then
With branchGLCache
LoadProperty(Of Guid)(BranchCacheIdProperty, BranchCacheId)
..etc
End With
End If
End Sub
I get an "invalid operation - fetch not allowed" which would make me think that the declararation of the DataPortal_Fetch method is incorrect. I have tried Protected, Shadows etc.. all to no avail. Can someone point out my problem?
Your DataPortal_Fetch() must accept a criteria parameter of the same type as the criteria you passed into DataPortal.Fetch(). In your example it is a SingleCriteria object, and your parameter types don't match.
Of course. Forest for the trees.
Thanks Rocky.
Copyright (c) Marimer LLC