The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

How to reference my entityspace DAL project from my dnn WAP project

Last post 10-11-2007, 2:00 PM by wadep. 4 replies.
Sort Posts: Previous Next
  •  10-10-2007, 4:02 PM 5776

    How to reference my entityspace DAL project from my dnn WAP project

    Hi,

    I have a solution containing a dnn WAP project and an entityspace DAL class lib project.

    My DAL project contains all the entityspace generated and custom classes.

    My WAP project has a project reference to my DAL class lib.

    Your 'Getting Started' pdf shows a class lib containing Generated and Custom classes, but does not show how this arrangement is used from a dnn WAP project.

    eg. How would I setup the entityspace database connection from my WAP project?

     Do you have a sample solution that demonstrates this situation?

    Any help appreciated.

     

    Regards,

     Paul.
     

  •  10-10-2007, 4:16 PM 5777 in reply to 5776

    Re: How to reference my entityspace DAL project from my dnn WAP project

    I would not create a separate class library to house your business objects. We are not a DAL, so the are some new paradigms you will need to get used to, and there is no need for the separate project. Do this, create a folder in your main dnn module project called 'BusinessObjects' within that folder you will have your 'Custom' and 'Generated' folders. Add your references, and your dynamic config routine called in the Page_Load method of your view control and your all set. You may find an example dnn dynamic config routine here.

    Regards,

    Scott Schecter
    EntitySpaces | My Site
  •  10-11-2007, 6:08 AM 5780 in reply to 5777

    Re: How to reference my entityspace DAL project from my dnn WAP project

    Hi,

    Thanks for the help so far.

    I have removed the DAL project from my solution.

    I have created Components > BusinessObjects > Custom and Generated folders within my WAP project.

    I have used myGeneration/EntitySpaces to create my Custom and Generated classes.

    I have amended my dnn project global.asax to include the following....

    Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)

    EntitySpaces.Interfaces.esProviderFactory.Factory = New EntitySpaces.LoaderMT.esDataProviderFactory()

    End Sub

     

     My dnn WAP projoct runs ok in debug, but i get "AugumentOutOfRangeException was handled by user code" when I try and perform the following LoadAll.

    Table1Collection table1Collection = new Table1Collection();

    table1Collection.LoadAll();

    Table1 contains the following columns in my SQL 2005 database.

    Id - integer primary key (seeded 1)

    AValue - Varchar(50)

     

    Any idea what I am doing wrong?

    Any help appreciated.

    Regards,

    Paul.

  •  10-11-2007, 6:14 AM 5781 in reply to 5780

    Re: How to reference my entityspace DAL project from my dnn WAP project

    You need to remove the Global.asax file from your module and use the dynamic config method I linked to above. This is where your connection info is set as well as assigning the loader.

    Regards,

    Scott Schecter
    EntitySpaces | My Site
  •  10-11-2007, 2:00 PM 5795 in reply to 5781

    Re: How to reference my entityspace DAL project from my dnn WAP project

    Thanks with your help on this.

    I've still got a few problems (I'm very new to EntitySpace).

    I have created a new post in EntitySpace API > General forum. Please could you take a look when you've got a moment.

     

    Regards,

     Paul.
     

View as RSS news feed in XML