RookeyFrame 通用页面 加载数据 原理
作者:互联网
我是一步一步跳转进去的哈
1、DataController里面的核心代码就一句
object list = CommonOperate.GetGridData(gridDataParams, out total, currUser);
2、CommonOperate.cs -> CommonOperate -> GetGridData
这个文件要注意一下哈,里面有两个类,一个是CommonOperate,还有一个是TempOperate
object list = GetPageEntities(out errMsg, gridDataParmas.ModuleId,此处省略.......
3、接着就一阵跳转,跳转了下面这几个方法,跟着里面的核心方法调整就没错了
GetPageEntities -> GetPageEntities -> ExecuteTempOperateReflectMethod ->ExecuteTempOperateReflectMethod
private static object ExecuteTempOperateReflectMethod(Type modelType, string methodName, object[] args, UserInfo currUser = null) { Type tempType = typeof(TempOperate<>); Type relectType = tempType.MakeGenericType(new Type[] { modelType }); //实例化对象 object obj = Activator.CreateInstance(relectType, new object[] { currUser }); MethodInfo method = relectType.GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public); //反射执行方法 FastInvoke.FastInvokeHandler fastInvoker = FastInvoke.GetMethodInvoker(method); object executedObj = fastInvoker(obj, args); return executedObj; }
标签:GetPageEntities,ExecuteTempOperateReflectMethod,object,加载,CommonOperate,跳转,Rooke 来源: https://www.cnblogs.com/guxingy/p/10977913.html