Ejemplo n.º 1
0
        public static Action <JsonString, object> CreateMethodJsonString(Type type)
        {
            string     source = SerializeCodeGenerator.GenerateJsonUsingJsonString(type);
            Assembly   ass    = SerializeCodeGenerator.Create(source);
            Type       obj    = ass.GetType(type.FullName.Replace('.', '_') + "_JsonExtensions");
            MethodInfo method = obj.GetMethod("ToJson");

            return((Action <JsonString, object>)Delegate.CreateDelegate(typeof(Action <JsonString, object>), null, method));
        }