chore: support no parameter.
parent
d084c92721
commit
367c57b00f
|
@ -204,7 +204,10 @@ namespace LeanCloud.Engine {
|
||||||
|
|
||||||
internal static async Task<object> Invoke(MethodInfo mi, object request) {
|
internal static async Task<object> Invoke(MethodInfo mi, object request) {
|
||||||
try {
|
try {
|
||||||
object[] ps = new object[] { request };
|
object[] ps = null;
|
||||||
|
if (mi.GetParameters().Length > 0) {
|
||||||
|
ps = new object[] { request };
|
||||||
|
}
|
||||||
if (mi.ReturnType == typeof(Task) ||
|
if (mi.ReturnType == typeof(Task) ||
|
||||||
(mi.ReturnType.IsGenericType && mi.ReturnType.GetGenericTypeDefinition() == typeof(Task<>))) {
|
(mi.ReturnType.IsGenericType && mi.ReturnType.GetGenericTypeDefinition() == typeof(Task<>))) {
|
||||||
Task task = mi.Invoke(null, ps) as Task;
|
Task task = mi.Invoke(null, ps) as Task;
|
||||||
|
|
Loading…
Reference in New Issue