private static string GetTableName(object table) { var tableQuery = (IQueryable)table; var rowType = tableQuery.ElementType; return(TableDefinitionAttribute.ClassTableName(rowType) ?? rowType.Name); }
public void TestTableNameAttribute() { var results = TableDefinitionAttribute.ClassTableName(typeof(DbClassLibrary.ActiveRecords.Employee)); Assert.IsNotEmpty(results); Assert.IsNull(TableDefinitionAttribute.ClassTableName(typeof(Employees))); Console.WriteLine(results); }