private static void SetClientContext(HybridDictionary clientContext)
{
if (HttpContext.Current == null)
{
if (ApplicationContext.ExecutionLocation == ExecutionLocations.Client)
lock (_syncClientContext)
AppDomain.CurrentDomain.SetData(_clientContextName, clientContext);
else
{
LocalDataStoreSlot slot = Thread.GetNamedDataSlot(_clientContextName);
Thread.SetData(slot, clientContext);
}
}
else
HttpContext.Current.Items[_clientContextName] = clientContext;
}
{
if (HttpContext.Current == null)
{
if (ApplicationContext.ExecutionLocation == ExecutionLocations.Client)
lock (_syncClientContext)
AppDomain.CurrentDomain.SetData(_clientContextName, clientContext);
else
{
LocalDataStoreSlot slot = Thread.GetNamedDataSlot(_clientContextName);
Thread.SetData(slot, clientContext);
}
}
else
HttpContext.Current.Items[_clientContextName] = clientContext;
}