ASP.NET/.NET Core ORM開(kāi)源項(xiàng)目
發(fā)布:2020-05-20
什么是ORM?
ORM(Object-relational mapping),中文翻譯為對(duì)象關(guān)系映射,是一種為了解決面向?qū)ο笈c關(guān)系數(shù)據(jù)庫(kù)存在的互不匹配的現(xiàn)象的技術(shù)。簡(jiǎn)單的說(shuō),ORM是通過(guò)使用描述對(duì)象和數(shù)據(jù)庫(kù)之間映射的元數(shù)據(jù),將程序中的對(duì)象自動(dòng)持久化到關(guān)系數(shù)據(jù)庫(kù)中。
為什么用ORM?
在程序開(kāi)發(fā)中,數(shù)據(jù)庫(kù)保存的表、字段與程序中的實(shí)體類之間是沒(méi)有關(guān)聯(lián)的,在實(shí)現(xiàn)持久化時(shí)非常不方便。那么,到底如何實(shí)現(xiàn)持久化呢?一種簡(jiǎn)單的方案是采用硬編碼方式,為每一種可能的數(shù)據(jù)庫(kù)訪問(wèn)操作提供單獨(dú)的方法。這種方案存在以下不足:
1、持久化層缺乏彈性,一旦出現(xiàn)業(yè)務(wù)需求的變更,就必須修改持久化層的接口;
2、持久化層同時(shí)與域模型與關(guān)系數(shù)據(jù)庫(kù)模型綁定,不管域模型還是關(guān)系數(shù)據(jù)庫(kù)模型發(fā)生變化,都需要修改持久化層的相關(guān)程序代碼,增加了軟件的維護(hù)難度。
ORM提供了實(shí)現(xiàn)持久化層的另一種模式,它采用映射元數(shù)據(jù)來(lái)描述對(duì)象關(guān)系的映射,使得ORM中間件能在任何一個(gè)應(yīng)用的業(yè)務(wù)邏輯層和數(shù)據(jù)庫(kù)層之間充當(dāng)橋梁。
項(xiàng)目名稱 | 項(xiàng)目描述 | 代碼倉(cāng)庫(kù)地址 |
---|---|---|
Insight.Database | Fast, lightweight .NET micro-ORM | https://www.github.com/orm-core-group/Insight.Database |
RepoDb | A dynamic, lightweight, efficient and very fast Hybrid ORM library for .NET. | https://www.github.com/orm-core-group/RepoDb |
nhibernate-core | NHibernate Object Relational Mapper | https://www.github.com/orm-core-group/nhibernate-core |
EntityFrameworkCore | Entity Framework Core is a lightweight and extensible version of the popular Entity Framework data access technology | https://www.github.com/orm-core-group/EntityFrameworkCore |
CYQ.Data | CYQ.Data是一款操作數(shù)據(jù)庫(kù)用的數(shù)據(jù)框架:安全穩(wěn)定、簡(jiǎn)潔易用、功能強(qiáng)大、性能優(yōu)越、內(nèi)置支持多數(shù)據(jù)庫(kù)、多語(yǔ)言、RSS、AOP、事務(wù)等功能。 | https://www.github.com/orm-core-group/cyqdata |
FreeSql | FreeSql is the most convenient ORM in dotnet. It supports Mysql, Postgresql, SqlServer, Oracle and Sqlite. | https://www.github.com/orm-core-group/FreeSql |
Chloe | A lightweight and high-performance Object/Relational Mapping(ORM) library for .NET --C# | https://www.github.com/orm-core-group/Chloe |
ServiceStack.OrmLite | Fast, Simple, Typed ORM for .NET | https://www.github.com/orm-core-group/ServiceStack.OrmLite |
Dapper | Dapper - a simple object mapper for .Net | https://www.github.com/orm-core-group/Dapper |
X | 新生命團(tuán)隊(duì)基礎(chǔ)框架X組件,包括日志、數(shù)據(jù)庫(kù)、網(wǎng)絡(luò)、RPC、序列化、緩存、Windows服務(wù)、多線程等模塊,支持.Net Framework/.netstandard/Mono。 | https://www.github.com/orm-core-group/X |
linq2db | Linq to database provider. | https://www.github.com/orm-core-group/linq2db |
Dapper-Plus | Dapper Plus - High-Efficient Bulk Actions (Insert, Update, Delete, and Merge) for .NET | https://www.github.com/orm-core-group/Dapper-Plus |
PetaPoco | Official PetaPoco, A tiny ORM-ish thing for your POCO's | https://www.github.com/orm-core-group/PetaPoco |
SmartSql | SmartSql = MyBatis .NET Core+ Cache(Memory or Redis) + R/W Splitting + Dynamic Repository + Diagnostics | https://www.github.com/orm-core-group/SmartSql |
simplestack.orm | Dapper with query generator from NServicekit.OrmLite | https://www.github.com/orm-core-group/simplestack.orm |
NPoco | Simple microORM that maps the results of a query onto a POCO object. Project based on Schotime's branch of PetaPoco | https://www.github.com/orm-core-group/NPoco |
AntData.ORM | vs插件或者t4一鍵生成entity支持配置非物理外鍵,分離linq轉(zhuǎn)sql引擎(原生linq非擴(kuò)展)和執(zhí)行dal功能,支持異步、支持netcore2.0。 | https://www.github.com/orm-core-group/AntData.ORM |
Chain | Micro ORM for .Net | https://www.github.com/orm-core-group/Chain |
DbEntry | DbEntry.Net (Leafing Framework) is a lightweight, high performance ORM compnent for .Net. | https://www.github.com/orm-core-group/DbEntry |
Paradigm.ORM | .NET Core ORM with dbfirst support, and code scaffolding features. This ORM supports different database sources. | https://www.github.com/orm-core-group/Paradigm.ORM |
Weed3 | 微型ORM框架 | https://www.github.com/orm-core-group/Weed3 |
SqlFu | Fast and versatile .net core data mapper/micro-orm | https://www.github.com/orm-core-group/SqlFu |
Dos.ORM | Dos.ORM(原名Hxj.Data)于2009年發(fā)布,2015年正式開(kāi)源,該組件已在數(shù)百個(gè)成熟項(xiàng)目中應(yīng)用。 | https://www.github.com/orm-core-group/Dos.ORM |
Razor.Orm | Razor.Orm | https://www.github.com/orm-core-group/Razor.Orm |
SqlSugar | Best ORM Fastest ORM Simple Easy Sqlite orm Oracle ORM Mysql Orm postgresql ORm SqlServer oRm | https://www.github.com/orm-core-group/SqlSugar |
Folke.Elm | Object-Relational Mapping library written in C# | https://www.github.com/orm-core-group/Folke.Elm |
CoPilot | Light weight object relational mapper (O/RM) for .Net | https://www.github.com/orm-core-group/CoPilot |