IdeaBlade DevForce 2010 Help Reference
UseAsyncNavigation Property
See Also  Example Send Feedback
IdeaBlade.EntityModel Assembly > IdeaBlade.EntityModel Namespace > EntityManager Class : UseAsyncNavigation Property



Gets or sets whether asynchronous queries are used when navigating relational properties.

Syntax

Visual Basic (Declaration) 
<ObsoleteAttribute("Use DefaultEntityReferenceStrategy.IsAsync")>
Public Property UseAsyncNavigation As Boolean
Visual Basic (Usage)Copy Code
Dim instance As EntityManager
Dim value As Boolean
 
instance.UseAsyncNavigation = value
 
value = instance.UseAsyncNavigation
C# 
[ObsoleteAttribute("Use DefaultEntityReferenceStrategy.IsAsync")]
public bool UseAsyncNavigation {get; set;}
C++/CLI 
[ObsoleteAttribute("Use DefaultEntityReferenceStrategy.IsAsync")]
public:
property bool UseAsyncNavigation {
   bool get();
   void set (    bool value);
}

Example

C#Copy Code
private Customer _aCustomer;

public void GetCustOrdersAsync() {

  DomainModelEntityManager mgr = = new DomainModelEntityManager();

  // Turn on async navigation.  This is a readonly property in Silverlight.
  mgr.UseAsyncNavigation = true;

  // Assume we already have a Customer instance. 
  // Navigate to customer orders.  
  // If UseAsyncNavigation is true and the orders aren't already in cache
  // the IsPendingEntityList flag will be on.

  var orders = _aCustomer.OrderSummaries;
  Assert.IsTrue(orders.IsPendingEntityList);

  // Setup a handler to be called when data is returned.
 orders.PendingEntityListResolved += PendingOrdersResolvedHandler;
}

private void PendingOrdersResolvedHandler(object sender, PendingEntityListResolvedEventArgs<OrderSummary> args) {
  // The original RelatedEntityList will now contain the returned entities, as will the 
  // args.ResolvedEntities list.

  Assert.IsFalse(_customer.OrderSummaries.IsPendingEntityList);
  Assert.IsTrue(_customer.OrderSummaries.Count > 0);
}

Remarks

In Silverlight applications this is a read-only property returning true, since all queries which can go to the data source must be executed asynchronously.

This flag defaults to false in non-Silverlight applications.

When UseAsyncNavigation is true, you will receive a "pending" entity or list if the navigation can't be satisfied from cache. These pending results are identified by the EntityAspect.IsPendingEntity and RelatedEntityList<T>.IsPendingEntityList properties. When a pending result is resolved a EntityAspect.PendingEntityResolved or RelatedEntityList<T>.PendingEntityListResolved event is fired.

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.