public static Task<object> ExecuteAsync( ObjectMethodExecutor actionMethodExecutor, object instance, object[] orderedActionArguments) { return actionMethodExecutor.ExecuteAsync(instance, orderedActionArguments); }
private static async Task <object> ExecuteHubMethod(ObjectMethodExecutor methodExecutor, THub hub, object[] arguments) { // ReadableChannel is awaitable but we don't want to await it. if (methodExecutor.IsMethodAsync && !IsChannel(methodExecutor.MethodReturnType, out _)) { if (methodExecutor.MethodReturnType == typeof(Task)) { await(Task) methodExecutor.Execute(hub, arguments); } else { return(await methodExecutor.ExecuteAsync(hub, arguments)); } } else { return(methodExecutor.Execute(hub, arguments)); } return(null); }
public Task RouteAsync(RouteContext route) { if (route.Handler == null) { route.Handler = async(context) => { object instance = context.RequestServices.GetRequiredService(this.Service); object[] methodArgs = context.Request.Parameters; object resultObj; if (_methodExecutor.IsMethodAsync) { resultObj = await _methodExecutor.ExecuteAsync(instance, methodArgs); } else { resultObj = _methodExecutor.Execute(instance, methodArgs); } context.Response.Success(resultObj); }; } return(Task.CompletedTask); }
public async Task AsyncExecutor_CompiledNormally_ExecuteAsync_WithAwait() { await _execCompiled.ExecuteAsync(this, _parameters); }
public async Task Compiled() => await _compiled.ExecuteAsync(this, _parameters);