Csla multiple Data Portal

Csla multiple Data Portal

Old forum URL: forums.lhotka.net/forums/t/11613.aspx

Antonio Sandoval posted on Monday, October 01, 2012

I'm working in a project on wich I need to save some business object to a Remote WCF server, and others to a local server. That means that I need to have two DataPortals.


How Can I do that? There is a way to create an instance of the local DataPortal with his own channel?


Thanks in advance.

JonnyBee replied on Tuesday, October 02, 2012

You can configure CSLA to use  remote dataportal and then use the [RunLocal] attribute to make force "root" data access methods use the local dataportal.

This is similar to the default handling of DataPortal_Create that has [RunLocal] attribute.

    protected override void DataPortal_Update()
            /// this update method will use LocalPortal
            /// no matter if the Csla config says to use a remote portal.


Copyright (c) Marimer LLC