2、ASP.NET MVC入门到精通——Entity Framework入门
<h2>实体框架(Entity Framework)简介</h2><p>简称EF</p>
<p><strong>与ADO.NET关系</strong></p>
<p>ADO.NET Entity Framework 是微软以 ADO.NET 为基础所发展出来的对象关系对应 (O/R Mapping) 解决方案,早期被称为 ObjectSpace,最新版本是EF7【CodeOnly功能得到了更好的支持】</p>
<p>实体框架Entity Framework 是 ADO.NET 中的一组支持开发面向数据的软件应用程序的技术。是微软的一个ORM框架。</p>
<p><strong>什么是</strong><strong>O/R Mapping</strong></p>
<p>广义上,ORM指的是面向对象的对象模型和关系型数据库的数据结构之间的相互转换。<br>狭义上,ORM可以被认为是,基于关系型数据库的数据存储,实现一个虚拟的面向对象的数据访问接口。理想情况下,基于这样一个面向对象的接口,持久化一个OO对象应该不需要要了解任何关系型数据库存储数据的实现细节。</p>
<p> <img src="//images0.cnblogs.com/blog2015/413851/201504/192110215732266.png" alt=""></p>
<p><strong>ORM in EF</strong></p>
<p>Entity Framework 利用了抽象化数据结构的方式,将每个数据库对象都转换成应用程序对象 (entity),而数据字段都转换为属性 (property),关系则转换为结合属性 (association),让数据库的 E/R 模型完全的转成对象模型,如此让程序设计师能用最熟悉的编程语言来调用访问。而在抽象化的结构之下,则是高度集成与对应结构的概念层、对应层和储存层,以 及支持 Entity Framework 的数据提供者 (provider),让数据访问的工作得以顺利与完整的进行。</p>
<p> (1) 概念层:负责向上的对象与属性显露与访问。</p>
<p> (2) 对应层:将上方的概念层和底下的储存层的数据结构对应在一起。</p>
<p> (3) 储存层:依不同数据库与数据结构,而显露出实体的数据结构体,和 Provider 一起,负责实际对数据库的访问和 SQL 的产生。</p>
<h3>EDM 设计器</h3>
<p> <img src="//images0.cnblogs.com/blog2015/413851/201504/192111049484047.png" alt=""></p>
<h3>EF Demo演示</h3>
<h3>一、数据库优先的方式</h3>
<p>1、创建控制台项目</p>
<p> <img src="//images0.cnblogs.com/blog2015/413851/201504/192111230267690.png" alt=""></p>
<p align="left">2、创建数据库(添加表)</p>
<div class="cnblogs_code">
<pre> <span style="color: rgba(0, 0, 255, 1)">CREATE</span> <span style="color: rgba(0, 0, 255, 1)">TABLE</span> <span style="color: rgba(255, 0, 0, 1)">[</span><span style="color: rgba(255, 0, 0, 1)">dbo</span><span style="color: rgba(255, 0, 0, 1)">]</span>.<span style="color: rgba(255, 0, 0, 1)">[</span><span style="color: rgba(255, 0, 0, 1)">T_Customer</span><span style="color: rgba(255, 0, 0, 1)">]</span><span style="color: rgba(0, 0, 0, 1)">(
</span><span style="color: rgba(255, 0, 0, 1)">[</span><span style="color: rgba(255, 0, 0, 1)">Id</span><span style="color: rgba(255, 0, 0, 1)">]</span> <span style="color: rgba(255, 0, 0, 1)">[</span><span style="color: rgba(255, 0, 0, 1)">int</span><span style="color: rgba(255, 0, 0, 1)">]</span> <span style="color: rgba(255, 0, 255, 1)">IDENTITY</span>(<span style="color: rgba(128, 0, 0, 1); font-weight: bold">1</span>,<span style="color: rgba(128, 0, 0, 1); font-weight: bold">1</span>) <span style="color: rgba(128, 128, 128, 1)">NOT</span> <span style="color: rgba(0, 0, 255, 1)">NULL</span><span style="color: rgba(0, 0, 0, 1)">,
</span><span style="color: rgba(255, 0, 0, 1)">[</span><span style="color: rgba(255, 0, 0, 1)">UserName</span><span style="color: rgba(255, 0, 0, 1)">]</span> <span style="color: rgba(255, 0, 0, 1)">[</span><span style="color: rgba(255, 0, 0, 1)">nvarchar</span><span style="color: rgba(255, 0, 0, 1)">]</span>(<span style="color: rgba(128, 0, 0, 1); font-weight: bold">32</span>) <span style="color: rgba(0, 0, 255, 1)">NULL</span><span style="color: rgba(0, 0, 0, 1)">,
</span><span style="color: rgba(255, 0, 0, 1)">[</span><span style="color: rgba(255, 0, 0, 1)">Age</span><span style="color: rgba(255, 0, 0, 1)">]</span> <span style="color: rgba(255, 0, 0, 1)">[</span><span style="color: rgba(255, 0, 0, 1)">int</span><span style="color: rgba(255, 0, 0, 1)">]</span> <span style="color: rgba(0, 0, 255, 1)">NULL</span><span style="color: rgba(0, 0, 0, 1)">,
</span><span style="color: rgba(255, 0, 0, 1)">[</span><span style="color: rgba(255, 0, 0, 1)">Address</span><span style="color: rgba(255, 0, 0, 1)">]</span> <span style="color: rgba(255, 0, 0, 1)">[</span><span style="color: rgba(255, 0, 0, 1)">nvarchar</span><span style="color: rgba(255, 0, 0, 1)">]</span>(<span style="color: rgba(128, 0, 0, 1); font-weight: bold">64</span>) <span style="color: rgba(0, 0, 255, 1)">NULL</span><span style="color: rgba(0, 0, 0, 1)">,
</span><span style="color: rgba(0, 0, 255, 1)">CONSTRAINT</span> <span style="color: rgba(255, 0, 0, 1)">[</span><span style="color: rgba(255, 0, 0, 1)">PK_T_Customer</span><span style="color: rgba(255, 0, 0, 1)">]</span> <span style="color: rgba(0, 0, 255, 1)">PRIMARY</span> <span style="color: rgba(0, 0, 255, 1)">KEY</span> <span style="color: rgba(0, 0, 255, 1)">CLUSTERED</span><span style="color: rgba(0, 0, 0, 1)">
(
</span><span style="color: rgba(255, 0, 0, 1)">[</span><span style="color: rgba(255, 0, 0, 1)">Id</span><span style="color: rgba(255, 0, 0, 1)">]</span> <span style="color: rgba(0, 0, 255, 1)">ASC</span><span style="color: rgba(0, 0, 0, 1)">
)</span><span style="color: rgba(0, 0, 255, 1)">WITH</span> (PAD_INDEX<span style="color: rgba(128, 128, 128, 1)">=</span> <span style="color: rgba(0, 0, 255, 1)">OFF</span>, STATISTICS_NORECOMPUTE<span style="color: rgba(128, 128, 128, 1)">=</span> <span style="color: rgba(0, 0, 255, 1)">OFF</span>, IGNORE_DUP_KEY <span style="color: rgba(128, 128, 128, 1)">=</span> <span style="color: rgba(0, 0, 255, 1)">OFF</span>, ALLOW_ROW_LOCKS<span style="color: rgba(128, 128, 128, 1)">=</span> <span style="color: rgba(0, 0, 255, 1)">ON</span>, ALLOW_PAGE_LOCKS<span style="color: rgba(128, 128, 128, 1)">=</span> <span style="color: rgba(0, 0, 255, 1)">ON</span>) <span style="color: rgba(0, 0, 255, 1)">ON</span> <span style="color: rgba(255, 0, 0, 1)">[</span><span style="color: rgba(255, 0, 0, 1)">PRIMARY</span><span style="color: rgba(255, 0, 0, 1)">]</span><span style="color: rgba(0, 0, 0, 1)">
) </span><span style="color: rgba(0, 0, 255, 1)">ON</span> <span style="color: rgba(255, 0, 0, 1)">[</span><span style="color: rgba(255, 0, 0, 1)">PRIMARY</span><span style="color: rgba(255, 0, 0, 1)">]</span></pre>
</div>
<p>3、 在项目中添加“数据实体模型”</p>
<p> <img src="//images0.cnblogs.com/blog2015/413851/201504/192111420268419.png" alt=""></p>
<p>点击下一步,选择“从数据库生成”</p>
<p> <img src="//images0.cnblogs.com/blog2015/413851/201504/192112039959875.png" alt=""></p>
<p>新建数据库连接,</p>
<p> <img src="//images0.cnblogs.com/blog2015/413851/201504/192112184174636.png" alt=""></p>
<p> <img src="//images0.cnblogs.com/blog2015/413851/201504/192112357148152.png" alt=""></p>
<p> <img src="//images0.cnblogs.com/blog2015/413851/201504/192112498548997.png" alt=""></p>
<p align="left">在代码中添加访问上下文保存到数据库的代码</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">using</span><span style="color: rgba(0, 0, 0, 1)"> System;
</span><span style="color: rgba(0, 0, 255, 1)">using</span><span style="color: rgba(0, 0, 0, 1)"> System.Collections.Generic;
</span><span style="color: rgba(0, 0, 255, 1)">using</span><span style="color: rgba(0, 0, 0, 1)"> System.Linq;
</span><span style="color: rgba(0, 0, 255, 1)">using</span><span style="color: rgba(0, 0, 0, 1)"> System.Text;
</span><span style="color: rgba(0, 0, 255, 1)">using</span><span style="color: rgba(0, 0, 0, 1)"> System.Threading.Tasks;
</span><span style="color: rgba(0, 0, 255, 1)">namespace</span><span style="color: rgba(0, 0, 0, 1)"> EFDemo
{
</span><span style="color: rgba(0, 0, 255, 1)">class</span><span style="color: rgba(0, 0, 0, 1)"> Program
{
</span><span style="color: rgba(0, 0, 255, 1)">static</span> <span style="color: rgba(0, 0, 255, 1)">void</span> Main(<span style="color: rgba(0, 0, 255, 1)">string</span><span style="color: rgba(0, 0, 0, 1)">[] args)
{
DemoSiteEntities entity </span>= <span style="color: rgba(0, 0, 255, 1)">new</span><span style="color: rgba(0, 0, 0, 1)"> DemoSiteEntities();
T_Customer customer </span>= <span style="color: rgba(0, 0, 255, 1)">new</span> T_Customer { Address=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">东海五彩金轮</span><span style="color: rgba(128, 0, 0, 1)">"</span>,Age=<span style="color: rgba(128, 0, 128, 1)">27</span>,UserName=<span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">楚留香</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">};
entity.T_Customer.Add(customer); </span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">这里只相当于构造sql语句</span><span style="color: rgba(0, 0, 0, 1)">
entity.SaveChanges(); </span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">这里才进行数据库操作,相当于按F5执行</span><span style="color: rgba(0, 0, 0, 1)">
}
}
}</span></pre>
</div>
<p>执行后,我们来看下数据库中,已经插入了一条数据</p>
<p> <img src="//images0.cnblogs.com/blog2015/413851/201504/192113123396596.png" alt=""></p>
<p>发散思维:如果让你实现一个ORM框架!</p>
<p> <img src="//images0.cnblogs.com/blog2015/413851/201504/192113246983486.png" alt=""><img src="//images0.cnblogs.com/blog2015/413851/201504/192113409175432.png" alt=""><img src="//images0.cnblogs.com/blog2015/413851/201504/192113527769407.png" alt=""></p>
<p>在EF中的实体数据模型(EDM)由以下三种模型和具有相应文件扩展名的映射文件进行定义。</p>
<p>· 概念架构定义语言文件 (.csdl) -- 定义概念模型。</p>
<p>· 存储架构定义语言文件 (.ssdl) -- 定义存储模型</p>
<p>· 映射规范语言文件 (.msl) -- 定义存储模型与概念模型之间的映射M。</p>
<p>实体框架 使用这些基于 XML 的模型和映射文件将对概念模型中的实体和关系的创建、读取、更新和删除操作转换为数据源中的等效操作。EDM 甚至支持将概念模型中的实体映射到数据源中的存储过程。</p>
<h3>EF中操作数据库的网关</h3>
<p>ObjectContext封装 .NET Framework 和数据库之间的连接。此类用作“创建”、“读取”、“更新”和“删除”操作的网关。</p>
<p>ObjectContext 类为主类,用于与作为对象(这些对象为 EDM 中定义的实体类型的实例)的数据进行交互。</p>
<p>ObjectContext 类的实例封装以下内容:</p>
<p>到数据库的连接,以 EntityConnection 对象的形式封装。</p>
<p>描述该模型的元数据,以 MetadataWorkspace 对象的形式封装</p>
<p>用于管理缓存中持久保存的对象的 ObjectStateManager 对象</p>
<p> <img src="//images0.cnblogs.com/blog2015/413851/201504/192114171986447.png" alt=""><img src="//images0.cnblogs.com/blog2015/413851/201504/192114268705526.png" alt=""></p>
<h2>IQueryable接口与IEnumberable区别</h2>
<p>IQueryable接口与IEnumberable接口的区别: IEnumerable<T> 泛型类在调用自己的SKip 和 Take 等扩展方法之前数据就已经加载在本地内存里了,而IQueryable<T> 是将Skip ,take 这些方法表达式翻译成T-SQL语句之后再向SQL服务器发送命令。也是延迟在我要真正显示数据的时候才执行。</p>
<p> linq to ef中使用Ienumberable与Iqueryable的区别,要用到的SQL Server Profiler工具</p>
<h2>Linq To EF</h2>
<p>数据库,这里还是使用northwnd.mdf了,下载地址:https://files.cnblogs.com/files/jiekzou/northwnd.zip</p>
<p><strong>简单查询:</strong><br>
</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">var</span> result = <span style="color: rgba(0, 0, 255, 1)">from</span> c <span style="color: rgba(0, 0, 255, 1)">in</span> Entities.Customer <span style="color: rgba(0, 0, 255, 1)">select</span> c;</pre>
</div>
<p><strong>条件查询:</strong></p>
<p> 普通linq写法:</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">var</span> result = <span style="color: rgba(0, 0, 255, 1)">from</span> c <span style="color: rgba(0, 0, 255, 1)">in</span> Entities.Customer <span style="color: rgba(0, 0, 255, 1)">where</span> c.Gender ==‘w’ <span style="color: rgba(0, 0, 255, 1)">select</span> c;</pre>
</div>
<p> Lambda表达式写法: </p>
<div class="cnblogs_code">
<pre> <span style="color: rgba(0, 0, 255, 1)">var</span> result = Entities.Customer.Where<Customer>(c =>c.Gender==‘w’);</pre>
</div>
<p> 排序分页写法:</p>
<div class="cnblogs_code">
<pre>IQueryable<Customers> cust10 = (<span style="color: rgba(0, 0, 255, 1)">from</span> c <span style="color: rgba(0, 0, 255, 1)">in</span><span style="color: rgba(0, 0, 0, 1)"> customers
</span><span style="color: rgba(0, 0, 255, 1)">orderby</span><span style="color: rgba(0, 0, 0, 1)"> c.CustomerID
</span><span style="color: rgba(0, 0, 255, 1)">select</span> c).Skip(<span style="color: rgba(128, 0, 128, 1)">0</span>).Take(<span style="color: rgba(128, 0, 128, 1)">10</span>);</pre>
</div>
<p>左外连接:可以的连接有Join 和 GroupJoin 方法。GroupJoin组联接等效于左外部联接,它返回第一个(左侧)数据源的每个元素(即使其他数据源中没有关联元素)。</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">var</span> query = <span style="color: rgba(0, 0, 255, 1)">from</span> d <span style="color: rgba(0, 0, 255, 1)">in</span><span style="color: rgba(0, 0, 0, 1)"> edm.Order_Details
join order </span><span style="color: rgba(0, 0, 255, 1)">in</span><span style="color: rgba(0, 0, 0, 1)"> edm.Orders
on d.OrderID equals order.OrderID
</span><span style="color: rgba(0, 0, 255, 1)">select</span> <span style="color: rgba(0, 0, 255, 1)">new</span><span style="color: rgba(0, 0, 0, 1)">
{
OrderId </span>=<span style="color: rgba(0, 0, 0, 1)"> order.OrderID,
ProductId </span>=<span style="color: rgba(0, 0, 0, 1)"> d.ProductID,
UnitPrice </span>=<span style="color: rgba(0, 0, 0, 1)"> d.UnitPrice
};</span></pre>
</div>
<p>排序分页:</p>
<div class="cnblogs_code">
<pre>IQueryable<Customers> cust10 = (<span style="color: rgba(0, 0, 255, 1)">from</span> c <span style="color: rgba(0, 0, 255, 1)">in</span><span style="color: rgba(0, 0, 0, 1)"> customers
</span><span style="color: rgba(0, 0, 255, 1)">orderby</span><span style="color: rgba(0, 0, 0, 1)"> c.CustomerID
</span><span style="color: rgba(0, 0, 255, 1)">select</span> c).Skip(<span style="color: rgba(128, 0, 128, 1)">0</span>).Take(<span style="color: rgba(128, 0, 128, 1)">10</span>);</pre>
</div>
<p>聚合</p>
<p>可使用的聚合运算符有Average、Count、Max、Min 和 Sum。</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">using</span> (<span style="color: rgba(0, 0, 255, 1)">var</span> edm = <span style="color: rgba(0, 0, 255, 1)">new</span><span style="color: rgba(0, 0, 0, 1)"> NorthwindEntities())
{
</span><span style="color: rgba(0, 0, 255, 1)">var</span> maxuprice = edm.Products.Max(p =><span style="color: rgba(0, 0, 0, 1)"> p.UnitPrice);
Console.WriteLine(maxuprice.Value);
}</span></pre>
</div>
<p>连接</p>
<p>可以的连接有Join 和 GroupJoin 方法。GroupJoin组联接等效于左外部联接,它返回第一个(左侧)数据源的每个元素(即使其他数据源中没有关联元素)。</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">using</span> (<span style="color: rgba(0, 0, 255, 1)">var</span> edm = <span style="color: rgba(0, 0, 255, 1)">new</span><span style="color: rgba(0, 0, 0, 1)"> NorthwindEntities())
{
</span><span style="color: rgba(0, 0, 255, 1)">var</span> query = <span style="color: rgba(0, 0, 255, 1)">from</span> d <span style="color: rgba(0, 0, 255, 1)">in</span><span style="color: rgba(0, 0, 0, 1)"> edm.Order_Details
join order </span><span style="color: rgba(0, 0, 255, 1)">in</span><span style="color: rgba(0, 0, 0, 1)"> edm.Orders
on d.OrderID equals order.OrderID
</span><span style="color: rgba(0, 0, 255, 1)">select</span> <span style="color: rgba(0, 0, 255, 1)">new</span><span style="color: rgba(0, 0, 0, 1)">
{
OrderId </span>=<span style="color: rgba(0, 0, 0, 1)"> order.OrderID,
ProductId </span>=<span style="color: rgba(0, 0, 0, 1)"> d.ProductID,
UnitPrice </span>=<span style="color: rgba(0, 0, 0, 1)"> d.UnitPrice
};
</span><span style="color: rgba(0, 0, 255, 1)">foreach</span> (<span style="color: rgba(0, 0, 255, 1)">var</span> q <span style="color: rgba(0, 0, 255, 1)">in</span><span style="color: rgba(0, 0, 0, 1)"> query)
Console.WriteLine(</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(128, 0, 0, 1)">{0},{1},{2}</span><span style="color: rgba(128, 0, 0, 1)">"</span><span style="color: rgba(0, 0, 0, 1)">,q.OrderId,q.ProductId,q.UnitPrice);
}</span></pre>
</div>
<p>不支持在查询中引用非标量闭包(如实体)。在执行这类查询时,会引发 NotSupportedException 异常,并显示消息“无法创建类型为“结束类型”的常量值。此上下文中仅支持基元类型(‘如 Int32、String 和 Guid’)</p>
<p>如下将会报异常的代码:</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">using</span> (<span style="color: rgba(0, 0, 255, 1)">var</span> edm = <span style="color: rgba(0, 0, 255, 1)">new</span><span style="color: rgba(0, 0, 0, 1)"> NorthwindEntities())
{
Customers customer </span>=<span style="color: rgba(0, 0, 0, 1)"> edm.Customers.FirstOrDefault();
IQueryable</span><<span style="color: rgba(0, 0, 255, 1)">string</span>> cc = <span style="color: rgba(0, 0, 255, 1)">from</span> c <span style="color: rgba(0, 0, 255, 1)">in</span><span style="color: rgba(0, 0, 0, 1)"> edm.Customers
</span><span style="color: rgba(0, 0, 255, 1)">where</span> c ==<span style="color: rgba(0, 0, 0, 1)"> customer
</span><span style="color: rgba(0, 0, 255, 1)">select</span><span style="color: rgba(0, 0, 0, 1)"> c.ContactName;
</span><span style="color: rgba(0, 0, 255, 1)">foreach</span> (<span style="color: rgba(0, 0, 255, 1)">string</span> name <span style="color: rgba(0, 0, 255, 1)">in</span><span style="color: rgba(0, 0, 0, 1)"> cc)
Console.WriteLine(name);
}</span></pre>
</div>
<p>上面的代码中,由于customer是引用类型而不是Int32,String,Guid的标量类型,所以在执行到where c==customer这个地方时,会报异常。</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">var</span> query = <span style="color: rgba(0, 0, 255, 1)">from</span> c <span style="color: rgba(0, 0, 255, 1)">in</span><span style="color: rgba(0, 0, 0, 1)"> db.Categories
join p </span><span style="color: rgba(0, 0, 255, 1)">in</span><span style="color: rgba(0, 0, 0, 1)"> db.Products
on c.CategoryID equals p.CategoryID
group </span><span style="color: rgba(0, 0, 255, 1)">new</span> {c, p} by <span style="color: rgba(0, 0, 255, 1)">new</span><span style="color: rgba(0, 0, 0, 1)"> {c.CategoryName} into g
</span><span style="color: rgba(0, 0, 255, 1)">select</span> <span style="color: rgba(0, 0, 255, 1)">new</span><span style="color: rgba(0, 0, 0, 1)">
{
g.Key.CategoryName,
SumPrice </span>= (<span style="color: rgba(0, 0, 255, 1)">decimal</span>?)g.Sum(pt=><span style="color: rgba(0, 0, 0, 1)">pt.p.UnitPrice),
Count </span>= g.Select(x=><span style="color: rgba(0, 0, 0, 1)">x.c.CategoryID).Distinct().Count()
};</span></pre>
</div>
<h2>延迟加载</h2>
<p>延迟加载:又称作懒加载。也就是Linq To EF并不是直接将数据查询出来,而是要用到具体数据的时候才会加载到内存</p>
<p>Include是将关联实体一块加载</p>
<p>ToList等可以直接将数据加载到内存</p>
<p>使用机制的选择</p>
<h2>关于上下文使用注意事项</h2>
<ul>
<li>不同的上下文实例来直接控制对应的实体</li>
<li>实体只能由一个上下文跟踪管理</li>
<li>EF上下文的ObjectStateMagner管理实体</li>
<li>批量操作时提交数据库的选择</li>
<li>延迟加载机制的选择</li>
<li>查询Distinct的使用数据量大小适时的选择是在内存中操作还是在数据库中操作</li>
</ul>
<h2>EF 跨数据库支持</h2>
<p>目前已有数个数据库厂商或元件开发商宣布要支持 ADO.NET Entity Framework:</p>
<p> (1) Core Lab,支持Oracle、MySQL、PostgreSQL 与 SQLite 数据库。</p>
<p> (2) IBM,实现 DB2 使用的 LINQ Provider。</p>
<p> (3) MySQL,发展 MySQL Server 所用的 Provider。</p>
<p> (4) Npqsql,发展 PostgreSQL 所用的 Provider。</p>
<p> (5) OpenLink Software,发展支持多种数据库所用的 Provider。</p>
<p> (6) Phoenix Software International,发展支持 SQLite 数据库的 Provider。</p>
<p> (7) Sybase,将支持 Anywhere 数据库。</p>
<p> (8) VistaDB Software,将支持 VistaDB 数据库。</p>
<p> (9) DataDirect Technologies,发展支持多种数据库所用的 Provider。</p>
<p> (10) Firebird,支持 Firebird 数据库。</p>
</div>
<div id="MySignature" role="contentinfo">
<div align="left"><div style="color: #111111"><table style="vertical-align: top">
<tbody><tr>
<td id="tdSign">博客地址:</td><td>http://www.cnblogs.com/jiekzou/</td>
<td rowspan="2"></td>
</tr>
<tr>
<td>博客版权:</td><td>本文以学习、研究和分享为主,欢迎转载,但必须在文章页面明显位置给出原文连接。<br>如果文中有不妥或者错误的地方还望高手的你指出,以免误人子弟。如果觉得本文对你有所帮助不如【推荐】一下!如果你有更好的建议,不如留言一起讨论,共同进步!<br>再次感谢您耐心的读完本篇文章。 </td>
</tr>
<tr><td>其它:</td><td>
.net-QQ群4:<span style="color: green">612347965</span>
java-QQ群:<span style="color: green">805741535</span>
H5-QQ群:<span style="color: green">773766020</span><br>
<div>我的拙作
《Vue3.x+TypeScript实践指南》
《ASP.NET MVC企业级实战》
《H5+移动应用实战开发》
《Vue.js 2.x实践指南》
《JavaScript实用教程 》
《Node+MongoDB+React 项目实战开发》
已经出版,希望大家多多支持!</div></td></tr>
</tbody></table></div>
</div>
<p style=" margin-bottom:-13px;padding-top: 15px;"><img src="https://images.cnblogs.com/cnblogs_com/jiekzou/780174/t_240929014358_%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20240929094331.png" style=" border:2px solid #ddd;border-radius:20px;" height="326" width="235"></p><br><br>
来源:https://www.cnblogs.com/jiekzou/p/4439998.html
頁:
[1]