NXDO.Data 4.4.689.2

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" />
                    
Directory.Packages.props
<PackageReference Include="NXDO.Data" />
                    
Project file
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
                    
#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
                    
Install as a Cake Addin
#tool nuget:?package=NXDO.Data&version=4.4.689.2
                    
Install as a Cake Tool

关于 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 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.

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.

Version Downloads Last Updated
4.4.689.2 92 7/5/2025
4.4.689.1 250 12/8/2024
4.4.689 203 11/16/2024
4.3.68.5 134 11/13/2024
4.3.68.4 257 11/1/2024
4.3.68.3 242 1/18/2024
4.3.68.2 198 1/7/2024
4.3.68.1 207 12/22/2023
4.2.6080.2 151 12/21/2023
4.2.6080.1 173 12/20/2023
4.2.6080 252 12/19/2023

1)内置优化 for NXDO.gRPC,2)支持 NetStandard2.1,3)调整分页器接口 DebugSQL 输出,4)Snowkey自动获取主机ID