Build a three-tier architecture with dapper ORM

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.