CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

dalManager.GetProvider() - System.NotImplementedException

rated by 0 users
Answered (Verified) This post has 1 verified answer | 2 Replies | 0 Followers

Top 50 Contributor
163 Posts
gajit posted on Fri, Feb 17 2012 2:01 PM

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.Generic
Imports System.Linq
Imports System.Text
Imports 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

 

 

 

 

 

 

Answered (Verified) Verified Answer

Top 50 Contributor
163 Posts
Answered (Verified) gajit replied on Fri, Feb 17 2012 2:59 PM
Verified by gajit

Never mind.

 

I'm an Idiot.

 

PersonDal did not exist in my Mock assembly.

Duh....

 

All Replies

Top 50 Contributor
163 Posts
Answered (Verified) gajit replied on Fri, Feb 17 2012 2:59 PM
Verified by gajit

Never mind.

 

I'm an Idiot.

 

PersonDal did not exist in my Mock assembly.

Duh....

 

Top 25 Contributor
422 Posts

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

Page 1 of 1 (3 items) | RSS

Copyright (c) 2006-2010 Marimer LLC. All rights reserved.
Email admin@lhotka.net for support.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems