Knight Data Access is an ORM (Object Relational Mapper), SQL to Entity Mapper, a LINQ provider, an ADO.NET Wrapper, a database generator, and a class generator. It is compatible with SQL Server, Oracle, MySQL, Firebird, MS Access, VistaDB, Sqlite, PostgreSQL, or any OLEDB or ODBC compliant database.
- ORM. Knight Data Access Layer contains functionality similar to NHibernate, Fluent NHibernate, and Entity Framework. It can map classes to database tables without any mappings if the property names are the same as the column names in the database. Relationships are also automatically mapped. The mapping can be overridden with attributes, code, or XML Files. See the Mapping section for more information.
- SQL to Entity Mapper. Knight Data Access layer has the ability to automatically map the results from a stored procedure or SQL to a class without any mapping. This functionality is similar to MicroORM frameworks such as Massive, PetaPOCO, and Dapper provide.
- LINQ Provider. Similar to Entity Framework, LINQ to SQL, and IQToolkit; Knight Data Access Layer has the ability to turn LINQ queries into the specific SQL dialect for several database providers including SQL Server, MS Access, Oracle, Firebird, VistaDB, Sqlite, MySQL, and PostgreSQL.
- ADO.NET Wrapper. Knight Data Access Layer provides a wrapper around ADO.NET similar to the Microsoft Data Application Block. This allows you to perform common operations such as executing stored procedures, truncating tables, creating databases, etc.
- Database Generator. Knight Data Access Layer has the ability to create a database, create tables, create indexes, and create foreign key constraints from classes or entire namespaces. It also has the ability to synchronize from a namespace to a database. Entity Framework and NHibernate have the ability to create databases from a namespace but cannot synchronize.
- Class Generator. Similar to LLBLGenPro, Entity Spaces, CodeSmith, and MyGeneration; Knight Data Access Layer has the ability to create classes from tables.
Code First Approach
If you like to create your classes first and then create your database from your model, you can certainly do that. Manually create your C# and VB.NET classes in your project and then execute the Setup("Namespace"). The Setup command is very powerful, it will create the database if it does not already exist, and then create all tables for all classes in a namespace. If the table already exists, missing columns will be added. All with one line of code!
Database First Approach
If you like to create your database first and create your the classes in your project from the database; you can certainly do that. Create your database and then execute a CreateClassFromTable for each class you would like to create. You can get a list of tables in the database by doing a GetDatabaseTables
No Approach
If you need to rapidly build a proof of concept application for your boss; classes do not need to be created at all. Knight Data Access Layer can retrieve a table into a DataTable that can be easily bound to a grid or it can return a simple dictionary that can be used. See the FillDataTable, LoadOne, and Load methods.