Vibrant discussion about CSLA .NET and using the framework to build great business applications.
OK, so I've made _some_ progress in my attempts to put together the necessary classes, etc in Vb.Net.
I've now recreated a simple EncapsulatedInvoke-type Windows FORMS application and all seemed to be going well.
Until now.
When I try to retrieve a personList, which is being executed in the Dataportal_Fetch method of my Library.Net.PersonList class.
I get a System.NotImplementedException My Fetch looks like this: Private Overloads Sub DataPortal_Fetch() IsReadOnly = False Dim rlce = RaiseListChangedEvents RaiseListChangedEvents = False Using dalManager = DataAccess.DalFactory.GetManager() Dim dal = dalManager.GetProvider(Of DataAccess.IPersonDal)() '----< error is here!! Using data = dal.Fetch() While data.Read() Dim item = DataPortal.FetchChild(Of PersonInfo)(data) Add(item) End While End Using End Using RaiseListChangedEvents = rlce IsReadOnly = True End Sub It definitely gets the correct dalManager and my IPersonDal looks like this: Imports System.Collections.GenericImports System.LinqImports System.TextImports System.Data Public Interface IPersonDal Function Fetch() As IDataReader Function Fetch(id As Integer) As IDataReader Function Insert(firstName As String, lastName As String) As Integer Sub Update(id As Integer, firstName As String, lastName As String) Sub Delete(id As Integer) End Interface
System.NotImplementedException
My Fetch looks like this:
Private Overloads Sub DataPortal_Fetch()
IsReadOnly = False
Dim rlce = RaiseListChangedEvents
RaiseListChangedEvents = False
Using dalManager = DataAccess.DalFactory.GetManager()
Dim dal = dalManager.GetProvider(Of DataAccess.IPersonDal)() '----< error is here!!
Using data = dal.Fetch() While data.Read() Dim item = DataPortal.FetchChild(Of PersonInfo)(data) Add(item) End While End Using End Using RaiseListChangedEvents = rlce IsReadOnly = True
End Sub
It definitely gets the correct dalManager and my IPersonDal looks like this:
Imports System.Collections.GenericImports System.LinqImports System.TextImports System.Data
Public Interface IPersonDal
Function Fetch() As IDataReader Function Fetch(id As Integer) As IDataReader Function Insert(firstName As String, lastName As String) As Integer Sub Update(id As Integer, firstName As String, lastName As String) Sub Delete(id As Integer)
End Interface
Any ideas?
Thanks,
Graham
Never mind.
I'm an Idiot.
PersonDal did not exist in my Mock assembly.
Duh....
Well - presuming this code is using what you published in previous posts, my first thought is whether the "NotImplementedException" is coming from your GetProvider() method because it can't construct the type you're asking for. The code you posted throws this very exception in that event.
HTH
- Scott