public static void Test() { var obj = FrameDLRObject.CreateInstance(new { touser = "", toparty = "", totag = "", msgtype = "text", agentid = "", text = new { content = new object[] { new { title = "", description = "", url = "" } } }, safe = 1 }, FrameDLRFlags.SensitiveCase); var dt = DateTime.Now; var fea = FrameExposedArray.From(new object[] { "a", "b", 1, DateTime.Now, DateTime.Now.AddDays(1) }); var n = fea.String.value; var n1 = fea.String[1]; dt = DateTime.Now; fea = FrameExposedArray.From(new object[] { 2.3, 5.6, new Dictionary <string, object>(), 's', new StaticClassTest(), 1, DateTime.Now, DateTime.Now.AddDays(1) }); var n2 = fea.dictionary.value; Console.WriteLine($"time cast {(DateTime.Now - dt).TotalMilliseconds}ms"); Console.ReadKey(); }
protected override ParameterStd ConvertParameters(object[] obj) { var fea = FrameExposedArray.From(obj); var rtn = new EWRAParameter(); rtn.CurrentHttpContext = fea.defaulthttpcontext.value; return(rtn); }
protected override ParameterStd ConvertParameters(object[] obj) { var rtn = new RazorParam(); if (obj != null && obj.Length > 0) { if (obj.Length == 1) { if (obj[0] is RazorParam) { rtn = (RazorParam)obj[0]; } else { var feo = FrameExposedObject.From(obj[0]); rtn.ViewPath = feo.ViewPath; rtn.CurrentHttpContext = feo.HttpContext; if (rtn.CurrentHttpContext == null) { rtn.CurrentHttpContext = feo.DefaultHttpContext.value; } rtn.Model = feo.Model; rtn.ViewList = feo.ViewList; } } else if (obj.Length == 4) { var fea = FrameExposedArray.From(obj); rtn.ViewPath = fea.String.value; rtn.CurrentHttpContext = fea.HttpContext.value; if (rtn.CurrentHttpContext == null) { rtn.CurrentHttpContext = fea.DefaultHttpContext.value; } rtn.Model = fea.Object.value; rtn.ViewList = fea.dictionary.value; } } return(rtn); }