NLite.Data 0.3.0.415

There is a newer version of this package available.
See the version list below for details.
dotnet add package NLite.Data --version 0.3.0.415
NuGet\Install-Package NLite.Data -Version 0.3.0.415
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NLite.Data" Version="0.3.0.415" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NLite.Data --version 0.3.0.415
#r "nuget: NLite.Data, 0.3.0.415"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install NLite.Data as a Cake Addin
#addin nuget:?package=NLite.Data&version=0.3.0.415

// Install NLite.Data as a Cake Tool
#tool nuget:?package=NLite.Data&version=0.3.0.415

NLite.Data Framework 是一个轻量简单易用的开源Linq ORM数据访问组件,支持Nullable类型和枚举类型,对Linq的谓词提供了完美的支持,旨在让绝大部份的主流数据库都使用 Linq 来进行程序开发,让开发人员访问数据库从SQL中解放出来,易学易用上手快,配置简单,并且提供了源代码下载,方便定制。支持多数据库,目前支持Access、SQLServer、SqlCE、SQLite、MySQL、ORACLE,未来还会支持更多的数据库。

       设计理念

       一: 约定胜于配置    

             连接字符串的配置完全遵循.Net 的连接字符串配置规范。

            表名映射原则: 默认情况下表名和实体类名完全一致,如果不一致那么可以通过TableAttribute标签来制定,下个版本或许将会增加其它的扩展方式

            列名映射原则:默认情况下实体的属性或字段和表中列名完全一致(不区分大小写),如果不一致那么可以通过ColumnAttribute标签来制定,下个版本或许将会增加其它的扩展方式

            单一主键映射原则:默认情况下实体的ID属性或”实体名称"+ID的属性自动映射为表的主键,当字段或属性的类型是Int型或Long类型时,那么该字段在数据库中应是自动增一或基于序列的方式

           多主键映射原则:如果表中有联合主键那么需要在是实体类中把对应的字段或属性添加IdAttribute标签即可

          一对多映射原则:假设有两个实体Customer 和 Order两个实体,Customer 里面包含一个Order的列表属性,那么只需要在Order类里面包含一个CustomerID 的属性或字段即可自动完成一对多映射,当然也可以通过AssociationAttribute标签来指定映射的ThisKey 和ThatKey来手动建立关联(建议自动建立)。

         多对一映射原则:假设有两个实体Customer 和 Order两个实体,Order里面包含一个Customer的属性引用,那么只需要在Order类里面包含一个CustomerID 的属性或字段即可自动完成一对多映射,当然也可以通过AssociationAttribute标签来指定映射的ThisKey 和ThatKey来手动建立关联(建议自动建立),其实一对多和多对一的映射完全一致都需要在多方的那里添加一个属性(一方的类名名称+“ID”)。
        多对多映射原则:不支持,需要转换成两个一对多映射,和数据库完全保持一致.

     二:基于关系的OR映射的原则

      表和实体是一一对应的,不支持多对多,完全遵循数据库的设计规范,降低开发人员的学习成本(因为数据库不支持多对多,如果OR映射支持多对多那么开发人员将要学习多对多的映射规则,比如NHibernate,ManyToMany、Set、Bag、Reverse等配置规范以及在多对对数据保存的时候也需要很多学习成本)

      三:无状态原则

   DbContext中没有保存实体的状态,没有任何数据缓存,所有的数据都是和数据库实时的,只要调用DbSet的Insert、Update、Save方法将立即和数据库进行对应的操作。

Product Compatible and additional computed target framework versions.
.NET Framework net35 is compatible.  net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.3.0.8221 1,996 12/5/2012
0.3.0.822 1,539 12/3/2012
0.3.0.415 1,472 11/19/2012
0.3.0 1,477 11/12/2012
0.2.0 1,471 11/12/2012

基于https://ndo.codeplex.com/SourceControl/changeset/97417/RC1_03%E7%89%88%E6%9C%AC

NLite.Data 0.3 RC1[0.3.0.415](2012/11/15)
1. 重构EntityModel 和MemberModel
2. 优化系统性能
3. 完善并详细测试SQLServer、Oracle、MySql,SQLite、SqlCE、Access的基本数据类型的相互转换函数
4. 添加公共接口的代码注释
5. 简化并增强增删改操作功能