예제 #1
0
        private static string GetTableName(object table)
        {
            var tableQuery = (IQueryable)table;
            var rowType    = tableQuery.ElementType;

            return(TableDefinitionAttribute.ClassTableName(rowType) ?? rowType.Name);
        }
예제 #2
0
        public void TestTableNameAttribute()
        {
            var results = TableDefinitionAttribute.ClassTableName(typeof(DbClassLibrary.ActiveRecords.Employee));

            Assert.IsNotEmpty(results);
            Assert.IsNull(TableDefinitionAttribute.ClassTableName(typeof(Employees)));
            Console.WriteLine(results);
        }