DevForce Help Reference
AuthorizedThreadId Property


The thread id that this EntityManager is authorized to execute on. An EntityManager can only execute on a single thread at one time.
Syntax
'Declaration
 
Public Property AuthorizedThreadId As Nullable(Of Integer)
'Usage
 
Dim instance As EntityManager
Dim value As Nullable(Of Integer)
 
instance.AuthorizedThreadId = value
 
value = instance.AuthorizedThreadId
public Nullable<int> AuthorizedThreadId {get; set;}
Remarks
This property can be set to another thread id to allow that thread to take over use of the EntityManager. This is an advanced technique and should only be used if you have extensive familiarity with threading.

This property can also be set to null to remove all cross threading checks from the EntityManager. There are a few common cases where this is useful: 1) when executing async tests from within the Visual Studio Test environment (because VS does not use a synchronization context that guarantees that asynchronous calls will be returned to the same thread that created them), 2) when executing an asynchronous operation from within one of the server side interception methods provided by the EntityServer, 3) when executing an asynchronous operation from within an ASP.NET worker process.

You may also override the default logic used by the EntityManager to perform the authorized thread id check by setting the SafeThreadingCheck to a method of your choice.

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

EntityManager Class
EntityManager Members

Send Feedback