コード例 #1
0
 public static Task <bool> InvokeGenericSaveMethod(this PostModelRequest request, string methodName, BaseModelClass item, IContextRepository contextRepository)
 => (Task <bool>)request
 .GetGenericMethod(methodName)
 .Invoke(null, new object[] { item, contextRepository });
コード例 #2
0
 private static MethodInfo GetGenericMethod(this PostModelRequest request, string methodName)
 => methodName.GetMethod().MakeGenericMethod
 (
     typeof(BaseModelClass).GetTypeInfo().Assembly.GetType(request.ModelType),
     typeof(BaseDataClass).GetTypeInfo().Assembly.GetType(request.DataType)
 );