Esempio n. 1
0
        public TestExample()
        {
            var fields = new List <DynaField>()
            {
                new DynaField("EmployeeID", typeof(int)),
                new DynaField("EmployeeName", typeof(string)),
                new DynaField("Designation", typeof(string))
            };


            dynamic obj = new DynamicMetaClass(fields);

            //set
            obj.EmployeeID   = 123456;
            obj.EmployeeName = "John";
            obj.Designation  = "Tech Lead";

            ;

            //or

            dynamic contact = new ExpandoObject();
            var     x       = new ExpandoObject() as IDictionary <string, Object>;
            //x.Add("ID",);


            object t1 = new object();

            t1.GetType().GetProperty("HI");
        }
Esempio n. 2
0
        private object GetMetaRowTypeDef(List <string> fields)
        {
            List <DynaField> dynaFields = new List <DynaField>();

            foreach (var fieldname in fields)
            {
                dynaFields.Add(new DynaField(fieldname, Type.GetType("A")));
            }
            dynamic obj = new DynamicMetaClass(dynaFields);

            return(obj);
        }