NXDO.Data
4.4.689.2
.NET 6.0
This package targets .NET 6.0. The package is compatible with this framework or higher.
.NET Standard 2.1
This package targets .NET Standard 2.1. The package is compatible with this framework or higher.
dotnet add package NXDO.Data --version 4.4.689.2
NuGet\Install-Package NXDO.Data -Version 4.4.689.2
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.4.689.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NXDO.Data" Version="4.4.689.2" />
<PackageReference Include="NXDO.Data" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NXDO.Data --version 4.4.689.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: NXDO.Data, 4.4.689.2"
#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.
#:package NXDO.Data@4.4.689.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NXDO.Data&version=4.4.689.2
#tool nuget:?package=NXDO.Data&version=4.4.689.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
关于 NXDO.Data
数据库实体类应用,速度优于官方 EntityFramework 实体类生成请采用 nxdo 提供的插件 NXDO.Addin2022.vsix
包版本
- 例:4.2.6080.1,其中4为大版本,2为次版本,6080则表示为Net6.0与Net8.0支持,最后的1为修订
- 当包在 Net6.0 下时,其引用文件为 NXDO.Data.N6.dll ,真实版本为 4.2.60.1
- 当包在 Net8.0 下时,其引用文件为 NXDO.Data.N8.dll ,真实版本为 4.2.80.1
示例
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 | net5.0 was computed. net5.0-windows was computed. 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. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.1
- Microsoft.Extensions.Configuration (>= 6.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 6.0.0)
- Microsoft.Extensions.Configuration.Json (>= 6.0.0)
- NXDO.Data.Reflection (>= 4.4.689.2)
-
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.4.689.2)
-
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.4.689.2)
-
net9.0
- Microsoft.Extensions.Configuration (>= 9.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.0)
- Microsoft.Extensions.Configuration.Json (>= 9.0.0)
- NXDO.Data.Reflection (>= 4.4.689.2)
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.WorkFlow
NCore WorkFlow |
|
NXDO.Data.Redis
Redis客户端,支持Redis的原生命令的执行 |
GitHub repositories
This package is not used by any popular GitHub repositories.
1)内置优化 for NXDO.gRPC,2)支持 NetStandard2.1,3)调整分页器接口 DebugSQL 输出,4)Snowkey自动获取主机ID