CQRSalad.Dispatching.ReflectionExtensions.GetAsyncMethodTaskReturnType C# (CSharp) Method

GetAsyncMethodTaskReturnType() static private method

static private GetAsyncMethodTaskReturnType ( this method ) : Type
method this
return System.Type
        internal static Type GetAsyncMethodTaskReturnType(this MethodInfo method)
        {
            Type type = method.ReturnType;
            if (IsAsync(method) && type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Task<>))
            {
                return type.GetGenericArguments()[0];
            }

            return null;
        }
    }