/// <summary> /// テーブルのバージョンを取得する /// </summary> /// <param name="type"></param> /// <returns></returns> public double GetTableVersion(Type type) { if (!type.IsDefined(typeof(DBTableAttribute), false)) { return(0); } DBTableAttribute att1 = type.GetCustomAttributes(typeof(DBTableAttribute), false)[0] as DBTableAttribute; // バージョンナンバー double tableVersion = att1.Version; return(tableVersion); }
/// <summary> /// テーブル名を取得する。 /// </summary> /// <param name="type"></param> /// <returns></returns> public string GetTableName(Type type) { if (!type.IsDefined(typeof(DBTableAttribute), false)) { return(null); } DBTableAttribute att1 = type.GetCustomAttributes(typeof(DBTableAttribute), false)[0] as DBTableAttribute; // テーブル名 string tableName = att1.Name != null ? att1.Name : type.Name; return('`' + tableName.ToUpper() + '`'); }