CslaDataPortalUrl
Old forum URL: forums.lhotka.net/forums/t/1936.aspx
Tony Reece posted on Friday, December 08, 2006
I have seen a few discussions related to this question, but none of them specifically addressed what I am trying to do.
I have a Windows Forms UI that will always use remoting. The UI needs to support the concept of Connecting and Disconnecting to different servers (DataPortals). To support this, when a user goes to Connect/Login they enter their Username, Password, and Server (URL).
I was hoping I would not need to modify the framework to make this work, but I can't think of any other way. Does anyone have any other suggestions?
Thanks,
Tony
xal replied on Friday, December 08, 2006
You can have a list of dataportal urls in the app.config or elsewhere that you can control. Then when the app starts or when you need to change the url you do:
System.Configuration.ConfigurationManager.AppSettings("CslaDataPortalUrl") = "The new url"
I've done that recently and it works just fine.
I also had to build a very simple dataportal proxy that simply reroutes the calls to a remoting or simple dataportal depending on a state variable. I just implement IDataPortalProxy and cache both a simple and a remoting proxy, when Fetch / Create /etc gets called, I call the corresponding method in either one of them.
All you have to do for csla to use this custom proxy is do this in the app.config:
<add key="CslaDataPortalProxy"
value="NameSpace.CustomDataPortalProxy, AssemblyName"/>
But by the looks of it, solution #1 is all you need. Solution #2 has a different target and needs of #1 if you use different dataportal urls anyway...
Andrés
Tony Reece replied on Tuesday, December 12, 2006
Thanks for the help...
albruan - Yes, I saw that post. It just seemed like there should be an easier way.
Andres - I think solution # 1 is all that I need. I will do some testing and see what happens.
Thanks again,
Tony
Copyright (c) Marimer LLC