We all know that ORM is called object Relationship Mapper, which is the ability to map our db with object.
And there are many ORM frameworks on the market, with heavyweight Entity Framework, lightweight dapper, Petapoco, etc.
If you like native SQL statements, and you like the simplicity of ORM and the pursuit of high performance, then the lightweight ORM Framework is your choice.
When it comes to lightweight ORM Framework Dapper's fame is bigger (because of the noble? ), but I chose to use Petapoco because:
- Provides an easier-to-use API
- Dapper provides only a series of overloads of query to map SQL to Entities
- Petapoco In addition, a series of helper methods such as insert/update/delete/save/paging are provided, such as:
- You can also specify table names, primary keys, and so on
- For more detailed example usage, see demo on the official website:http://www.toptensoftware.com/petapoco/
- Performance is comparable to dapper (I self-test faster than Dapper)
- According to the test results of Dapper official website (https://github.com/StackExchange/dapper-dot-net) Petapoco performance ranked 4,dapper 2nd
- The 1th is hard coding, the 3rd Servicestack.ormlite is charged, and there are too many dependencies, dapper and Petapoco are single. cs Files without dependencies
- I wrote the test comparison results found that Petapoco faster than dapper, specific people can self-test
As of 2016-10-05, Petapoco does not support. NET core, but it is not difficult to have the source ported to. NET core, which is the code I ported, which you can download yourself.
: Click Download
Petapoco-Lightweight and high performance ORM Framework (supports. NET Core)