NXDO.Data
4.2.6080.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package NXDO.Data --version 4.2.6080.1
NuGet\Install-Package NXDO.Data -Version 4.2.6080.1
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="NXDO.Data" Version="4.2.6080.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NXDO.Data --version 4.2.6080.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: NXDO.Data, 4.2.6080.1"
#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 NXDO.Data as a Cake Addin #addin nuget:?package=NXDO.Data&version=4.2.6080.1 // Install NXDO.Data as a Cake Tool #tool nuget:?package=NXDO.Data&version=4.2.6080.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
简述
数据库实体类应用,速度优于官方 EntityFramework<br> 实体类生成请采用 nxdo 提供的插件 NXDO.Addin2022.vsix
示例
1.实体类定义
[Table("AUser")]
public class AUser : NXDO.Data.Entity {
[Field(Flag = FieldFlag.IsKey | FieldFlag.IsAutoValue)]
public long UserId { get; set; }
[Field]public String UserName { get; set; }
[Field]public String Password { get; set; }
[Field]public bool Sex { get; set; }
[Field]public long? RoleId { get; set; }
}
2.连接与关闭
//装载
NXDO.Data.Factory.DbContext.Load(); //显示调用环境装载,最好显示调用关闭
//显示调用关闭
(DbContext.Current as IDisposable).Dispose();
using(var ctxt = NXDO.Data.Factory.DbContext.Load()){
//...
}
3.插入与查询
using NXDO.Data.Extension; //扩展方法在此命名空间下
new AUser {
UserName = "xx",
Password = "***",
Sex = true,
RoleId = 1L,
}.DBExecute().DataCreate();
//linq
var rs = new AUser().DBLinq().ToPage().TakeAny(0);
var rs = (from m in new AUser().DBLinq() select m).ToList();
配置
文件名:NXDO.Data.Provider.json<br> 保证该配置文件在 “应用程序环境的根目录”
{
"active": 0,
"providers": [
{
"key": 0,
"providerName": "MySql.Data.MySqlClient",
"providerAssemblyFileName": "MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data.dll",
"providerAssemblyQualifiedName": "MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.0.27.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d", //8.0.27.0 按使用的版本修改
"connectionString": "server=localhost;port=3308;database=AUserSys;user id=root;password=***;allowuservariables=True;characterset=utf8;",
//ling格式化类型,可空,框架自动匹配
//"linqFormatterType": "NXDO.Data.Linq.Formatter.DbMySqlFormatter, NXDO.Data.N6, Version=4.0.60.1, Culture=neutral, PublicKeyToken=a3a15b70fe786e3e", //4.0.60.1 按使用的版本修改
"dbType": "MySqlDbType",
"parameter": "@",
"syncAutoID": "select last_insert_id()",
"quotePrefix": "`",
"quoteSuffix": "`",
"usedAS": true,
"usedJSON": false,
"usedSnowId": false,
"snowIdTables": "",
"alias": "t1", //分页时的别名,用于$SelectFields
"pageRowCount": "pageIndex * pageSize",
"pageMaxCount": "",
//支持linq查询
//"pageSQL": "SELECT $SelectFields FROM $Table WHERE $Filter $Order LIMIT $PageRowCount, $PageSize"
//此语句,不支持 linq的DbPage查询
"pageSQL": "SELECT $SelectFields FROM $Table t1 join (select $Field from $BaseTable WHERE $Filter $Order LIMIT $PageRowCount, $PageSize) t2 WHERE t1.$Field=t2.$Field and $Filter"
},
{
"key" : 1,
//ms sqlserver ...
},
{
"key" : 2,
//oracle ...
}
]
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Microsoft.Extensions.Configuration (>= 6.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 6.0.0)
- Microsoft.Extensions.Configuration.Json (>= 6.0.0)
- NXDO.Data.Reflection (>= 4.2.6080.1)
-
net8.0
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.0)
- Microsoft.Extensions.Configuration.Json (>= 8.0.0)
- NXDO.Data.Reflection (>= 4.2.6080.1)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on NXDO.Data:
Package | Downloads |
---|---|
NXDO.WebAPI.ZhuBird
朱雀,亦称朱鸟,形体似凤凰,古代神话中的南方之神。Rosefinch, also known as "Zhu bird" physical may Phoenix, the ancient Chinese myth of the God of the South. |
|
NXDO.WebAPI
NCore WebHost MicroServices & WebApi & WebVUE |
|
NXDO.Data.Security
MemberRole & Security NC6 |
|
NXDO.Data.Redis
Redis客户端,支持Redis的原生命令的执行 |
|
NXDO.WorkFlow
NCore WorkFlow |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
4.4.689 | 143 | 11/16/2024 |
4.3.68.5 | 89 | 11/13/2024 |
4.3.68.4 | 216 | 11/1/2024 |
4.3.68.3 | 218 | 1/18/2024 |
4.3.68.2 | 174 | 1/7/2024 |
4.3.68.1 | 180 | 12/22/2023 |
4.2.6080.2 | 127 | 12/21/2023 |
4.2.6080.1 | 149 | 12/20/2023 |
4.2.6080 | 226 | 12/19/2023 |
4.1.6080.1 (Db支持器装载支持外部定义 & 性能调优)