DNLiCore_DB 1.0.8

DNLiCore_DB 是属于DNLiCore框架下的一个数据库工具类,目标支持数据库类型包括 MySql,SqlServer,SqlLite
其中包括3种执行框架 Ado.net:SqlHelper,轻量级ORM:Petapoco,标准EF框架:EF Core
使用方法:1.安装 DNLiCore_DB
 "ConnectionStrings": {
                               "SqlServerConnection": "Server=******;Database=****;User ID=****;Password=*****;",
                               "MySqlConnection": "Database='*****';Data Source=****;User ID=****;Password=******.;CharSet=utf8;SslMode=None",
                               "SqlLiteConnection": "Data Source=ItcastCater.db"
   ①使用ado.net 注入方式
services.AddSingleton(typeof(DNLiCore_DB.IMySqlHelper), new DNLiCore_DB.MySqlHelper(Configuration.GetConnectionString("MySqlConnection")));
②使用petapoco 注入方式,
services.AddSingleton(typeof(DNLiCore_DB.IPetaPocoHelper), new DNLiCore_DB.PetaPocoHelper(Configuration.GetConnectionString("MySqlConnection"), 0));
 1.1 通过程序包管理控制台生成DBContext和实体输入,按需引用DNLiCore_DB
                  Scaffold-DbContext -Force  "Server=*****;User Id=****;Password=******;Database=drewtest" -Provider "Pomelo.EntityFrameworkCore.MySql"  
                   2.如果有需要只生成单表的加个 -Table 表名
 1.2 进行ef注入
services.AddSingleton(typeof(DNLiCore_DB.IRepository), new DNLiCore_DB.Repository(new DNLiCore_Model.drewtestContext()));
 static DNLiCore_DB.IPetaPocoHelper mypetaPocoHelper;
 public HomeController(DNLiCore_DB.IPetaPocoHelper petaPocoHelper)
           mypetaPocoHelper = petaPocoHelper;           
 public IActionResult Index()
var mylss = mypetaPocoHelper.Fetch(" select * from userInfo ");

There is a newer version of this package available.
See the version list below for details.
Install-Package DNLiCore_DB -Version 1.0.8
dotnet add package DNLiCore_DB --version 1.0.8
<PackageReference Include="DNLiCore_DB" Version="1.0.8" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DNLiCore_DB --version 1.0.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: DNLiCore_DB, 1.0.8"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install DNLiCore_DB as a Cake Addin
#addin nuget:?package=DNLiCore_DB&version=1.0.8

// Install DNLiCore_DB as a Cake Tool
#tool nuget:?package=DNLiCore_DB&version=1.0.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Release Notes

Summary of changes made in this release of the package.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.1.2 448 1/15/2019
1.1.1 397 1/7/2019
1.1.0 435 1/7/2019
1.0.9 409 12/27/2018
1.0.8 459 12/9/2018
1.0.7 549 12/9/2018
1.0.6 472 12/9/2018
1.0.5 378 12/7/2018
1.0.4 403 12/7/2018
1.0.3 500 12/7/2018
1.0.2 396 12/7/2018