Пример #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);
        }