using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace CSFrameworkV5.Core.CodeGenerator { public sealed class ORM_Tools { /// /// 根据ORM获取特性内定义的表名 /// /// ORM类的类型,如:tb_Customer,使用typeof(tb_Customer)获取 /// public static string GetTableName(Type ORM) { var ta = ORM.GetCustomAttributes(typeof(ORM_TableAttribute), false); if (ta.Length > 0) return (ta[0] as ORM_TableAttribute).TableName; else return ""; } } }