/// <summary> /// 处理数据 /// </summary> /// <param name="Controller"></param> /// <param name="Method"></param> /// <returns></returns> protected virtual ISocketResult ExecuteCallDataHandler(Type Controller, MethodInfo Method, ISocketResult Param) { var Ctrl = Activator.CreateInstance(Controller); var ParamInfo = Method.GetParameters().FirstOrDefault(); Object Result; if (ParamInfo?.ParameterType == typeof(PageQuery)) { PageQuery TargetParamerter = Param.SocketJsonData.ToModel <PageQuery>(); Result = ((Task <ActionResult <Object> >)Method.Invoke(Ctrl, new[] { TargetParamerter })).Result.Value; if (Result != null) { return new SocketResultDefault { SocketJsonData = Result.ToJson() } } ; } else if (ParamInfo?.ParameterType == typeof(ResultProvider)) { ResultProvider TargetParamerter = ResultProvider.SetValue(null, Param.SocketJsonData.ToModel <Dictionary <string, Object> >()); Result = ((Task <ActionResult <Object> >)Method.Invoke(Ctrl, new[] { TargetParamerter })).Result.Value; if (Result != null) { return new SocketResultDefault { SocketJsonData = Result.ToJson() } } ; } else { Result = ((Task <ActionResult <Object> >)Method.Invoke(Ctrl, null)).Result.Value; if (Result != null) { return new SocketResultDefault { SocketJsonData = Result.ToJson() } } ; } return(ExecuteNoAuthor()); }
public List <string> Get() { TestClass tc = new TestClass(); var data = ResultProvider.SetValue("Name", new Dictionary <object, object> { { "Key", "Value" } }); tc.ByTraceInvoke("TestMethods", new object[] { data }); //HttpMultiClient.HttpMulti.AddNode("https://www.baidu.com").Build().RunString(); //var xx = Sugar.DB.Queryable<WarnInfo>().Select(t => new WarnInfo //{ // Title = t.Title, // ZhaiYao = t.ZhaiYao //}).ToList(); //var x = xx.FirstOrDefault(); // x.Title = "测试1"; // Sugar.DB.Updateable(x).UpdateColumns(t => t.Title).Where(t => t.ZhaiYao == "111").ExecuteCommand(); return(new List <string>()); }