A simple three-tier architecture written using the dapper Relational object mapper.
Dapper:stackoverflow in the use of a miniature ORM, the framework of the overall efficiency of the high, lightweight ORM framework. There are more extensions on the Web. Here is just a simple call to the method in dapper.
UI layer:
Dapper.console: A simple console program.
BLL Business Logic Layer:
DAPPER.IBLL: Abstract interface for the business logic layer.
DAPPER.BLL: The specific implementation of the business logic layer. (different DAL layers are called depending on the configuration file)
Dal Data Access Layer:
Dapper.idal: Abstract interface for the data access layer. Facilitates the extension of the program.
Dapper.sqlserverdal: The implementation layer of different databases, derived from the Idal interface. (There may be oracledal, mysqldal, etc.)
Entity class:
Dapper.model: Database entity class
Decoupling:
Dapper.factory: Factory. Create the corresponding instance through the factory. Dalfactory create a specific dal,connectionfactory to create a IDbConnection instance for dapper to use.
Unit tests:
Dapper.test: Perform unit tests on the database. The app. config under Dapper.console cannot be read directly in the unit test project. Copy it over.
For mock testing, you can refer to the test framework using MS Fakes, MOQ, and so on.
Build a three-tier architecture with dapper ORM