NXDO.Data 4.3.68.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package NXDO.Data --version 4.3.68.1                
NuGet\Install-Package NXDO.Data -Version 4.3.68.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.3.68.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NXDO.Data --version 4.3.68.1                
#r "nuget: NXDO.Data, 4.3.68.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.3.68.1

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

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

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

1)支持XPlugin的配置,并提供给第三方连接器 2)针对上个版本注册调优