/// <summary> /// Throws an exception if a synchronous data portal call is trying to invoke an asynchronous method on the client. /// </summary> /// <param name="isSync">True if the client-side proxy should synchronously invoke the server.</param> /// <param name="obj">Object containing method.</param> /// <param name="methodName">Name of the method.</param> /// <returns></returns> internal static void ThrowIfAsyncMethodOnSyncClient(bool isSync, object obj, string methodName) { if (isSync && ApplicationContext.ExecutionLocation != ApplicationContext.ExecutionLocations.Server && MethodCaller.IsAsyncMethod(obj, methodName)) { throw new NotSupportedException(string.Format(Resources.AsyncMethodOnSyncClientNotAllowed, methodName)); } }
internal static void ThrowIfAsyncMethodOnSyncClient(bool isSync, System.Reflection.MethodInfo method) { if (isSync && ApplicationContext.ExecutionLocation != ApplicationContext.ExecutionLocations.Server && MethodCaller.IsAsyncMethod(method)) { throw new NotSupportedException(string.Format(Resources.AsyncMethodOnSyncClientNotAllowed, method.Name)); } }