예제 #1
0
        public static T GetClassCsharp <T>(TableSql tableSql)
        {
            string className = "TestsORM" + "." + "User";
            var    myObj     = Activator.CreateInstance(Type.GetType(className)); // namespace + type
            Type   test      = myObj.GetType();

            return((T)myObj);
        }
예제 #2
0
        public static TableSql GetTableSql <T>(T objectClass)
        {
            TableSql table = new TableSql();

            table.TableName = ToSql(typeof(T).Name);

            foreach (PropertyInfo prop in typeof(T).GetProperties())
            {
                table.ColumnList.Add(ToSql(prop.Name));
            }
            return(table);
        }