DiLu.Expansion.DataStorage 1.1.7

dotnet add package DiLu.Expansion.DataStorage --version 1.1.7
                    
NuGet\Install-Package DiLu.Expansion.DataStorage -Version 1.1.7
                    
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="DiLu.Expansion.DataStorage" Version="1.1.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DiLu.Expansion.DataStorage" Version="1.1.7" />
                    
Directory.Packages.props
<PackageReference Include="DiLu.Expansion.DataStorage" />
                    
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 DiLu.Expansion.DataStorage --version 1.1.7
                    
#r "nuget: DiLu.Expansion.DataStorage, 1.1.7"
                    
#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 DiLu.Expansion.DataStorage@1.1.7
                    
#: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=DiLu.Expansion.DataStorage&version=1.1.7
                    
Install as a Cake Addin
#tool nuget:?package=DiLu.Expansion.DataStorage&version=1.1.7
                    
Install as a Cake Tool

的卢Redis扩展组件

介绍

的卢DataStorage操作

使用说明

SqlSugar

SqlSugar文档官网

//注册使用
var connectionConfig = new[] { new SqlSugarConnectionConfig { Name = "default", ConnectionString = "connectionString" } };
builder.Services.AddSqlSugarIocExpansion<long>(connectionConfig);

//如果使用Repository 可以实现SqlSugarRepository仓储
//可以使用autofun或自带IOC注册Repository
builder.Services.AddScoped<StudentRepository>();

内置Model类型

1.DefaultModel

2.UlidModel

支持Ulid字段从数据库取出转换

[SugarColumn(IsPrimaryKey = true, Length = 26, SqlParameterDbType = typeof(UlidConvert))]
public Ulid Id { get; set; }

内置默认列名interface

Cs File Name
IHasCreationTime
IHasCreatorId
IHasIsDelete
IHasLastModificationTime
IHasLastModifierId
IHasPrimaryKey
IHasSortOrder

使用全局CreatorId和LastModifierId

使用此方法在操作数据库时自动给CreatorId和LastModifierId赋值 相关AOP方法 AddSqlDataFilter

DataStorageOperateContract<T>.OperateAccountId.Value

动态获取连接

var connection = new ConnectionConfig
{
    ConfigId = "test2",
    ConnectionString = "connectionString",
    DbType = DbType.SqlServer,
    IsAutoCloseConnection = true
};
var test2Db = studentRepository.GetDynamicConnectionScope<long>(connection, 5);
Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.7 140 4/27/2025
1.1.6 137 4/27/2025
1.1.5 130 4/27/2025
1.1.4 134 4/27/2025
1.1.2 131 4/27/2025
1.1.1 85 4/26/2025
1.1.0 152 4/21/2025
1.0.0 158 4/21/2025