Official PetaPoco and petapoco websites
We all know that ORM is called Object Relationship er, that is, we can use object to map our db.
In addition, there are many orm frameworks on the market, including heavyweight Entity frameworks, lightweight Dapper and PetaPoco.
If you like native SQL statements, simple ORM, and high performance, the lightweight ORM framework is your best choice.
Speaking of the lightweight ORM framework Dapper ?), However, I chose PetaPoco because:
- Provides easier-to-use APIs
- Dapper only provides a series of Query reloads for ing SQL statements into entities.
- In addition, PetaPoco also provides a series of Helper methods such as Insert/Update/Delete/Save/paging, such:
- You can also specify the table name and primary key.
- For more detailed examples, see the DEMO on the official website: http://www.toptensoftware.com/petapoco/
- Performance comparable to Dapper (I tested faster than Dapper)
- According to Dapper official website (https://github.com/StackExchange/dapper-dot-net) Test Results PetaPoco performance ranking 4th, Dapper 2nd
- 1st is hard-coded, 3rd of ServiceStack. OrmLite is charged, and there are too many dependencies. Dapper and PetaPoco are single. cs files with no Dependencies
- My own test results show that PetaPoco is faster than Dapper. You can test it on your own.
As of February 5, PetaPoco does not support. NET Core, but it is not difficult to port source code to. NET Core. below is the transplanted code. You can download it by yourself.
: Click Download