Hey yall. Looking for different ideas on how to achieve this elegantly.
I would like to have a flag that says that we have logically gone through the DataPortal mechanism...don't care about the physical location...local or remote.
On the surface one might think (as I first did) to use the Csla.ApplicationContext.ExecutionLocations.Server feature. The problem is that this property maps to the 'physical' location of the code. So in a local deployment that property will never say Server even though logically we are operating on the server side of the DataPortal. I want a way to know that I am on the "logical" server side of the DataPortal.
Obviously I could
Problem with #1 is it runs me into the issue that Rocky discusses on page 249 of his latest book.
Problem with #2 is it is a lot of redundant code
Problem with #3 is it makes it that much harder to keep updated with new CSLA updates later
Any other bright ideas out there
Sean
Seek and ye shall find! LOL :-)
Looks like someone already asked for this because I just noticed the property
Csla.ApplicationContext.LogicalExecutionLocation
Sweet! I have to remember to poke around in intellesense first next time.
Sean
Any idea what version of the framework this is in? I tried looking through the change management logs but couldn't find this property being added and I can't find it in the current version I'm using (3.5.1).
Thanks,
- Chris
I am using the latest 3.6 code. I also didn't remember it being there before, but maybe I just missed it.
Works great!
Sean
Have you tried this when using the local data portal?
I'm running CSLA 3.5.1, and it appears in the CSLA code that the value of ExecutionLocation remains "client" all the time unless you are using a remote data portal:
private static void SetContext(DataPortalContext context)
{
// if the dataportal is not remote then // do nothing if (!context.IsRemotePortal) return; // set the context value so everyone knows the // code is running on the server ApplicationContext.SetExecutionLocation(ApplicationContext.ExecutionLocations.Server);Mea culpa. I should have been paying closer attention.
(And that looks like another reason to upgrade to 3.6...)
It was added in 3.6 version
--Sergey.
Copyright (c) Marimer LLC