コード例 #1
0
 /// <summary>
 /// Extension method to perform sync/async version of DataServiceContext.LoadProperty dynamically
 /// </summary>
 /// <param name="context">The context to call call load property on</param>
 /// <param name="continuation">The asynchronous continuation</param>
 /// <param name="async">A value indicating whether or not to use async API</param>
 /// <param name="entity">The entity to load a property on</param>
 /// <param name="propertyName">The name of the property to load</param>
 /// <param name="onCompletion">A callback for when the call completes</param>
 public static void LoadProperty(this WrappedDataServiceContext context, IAsyncContinuation continuation, bool async, WrappedEntityInstance entity, string propertyName, Action <WrappedQueryOperationResponse> onCompletion)
 {
     ExceptionUtilities.CheckArgumentNotNull(context, "context");
     AsyncHelpers.InvokeSyncOrAsyncMethodCall <WrappedQueryOperationResponse>(continuation, async, () => context.LoadProperty(entity, propertyName), c => context.BeginLoadProperty(entity, propertyName, c, null), r => context.EndLoadProperty(r), onCompletion);
 }