IdeaBlade.EntityModel Assembly > IdeaBlade.EntityModel Namespace > EntityManager Class : AuthorizedThreadId Property |
'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;}
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.
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