Common.EFCore.SQLite 1.6.2

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

Common.EFCore.SQLite

操作例子

services.AddEntityFramework<AuthDbContext>(options =>
{
    options.ConnectionString = connectionString;
    options.Schema = "auth";
});

SQL 日志输出

包内部不会再创建独立的 ConsoleLoggerProvider,而是复用宿主应用 DI 中的 ILoggerFactory。如需在控制台打印 EF Core 执行的 SQL,请在宿主应用 Program.cs 中配置日志:

using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;

builder.Logging.AddFilter(DbLoggerCategory.Database.Command.Name, LogLevel.Information);
builder.Logging.AddConsole();

如果只想通过 appsettings.json 控制日志级别,可配置:

{
  "Logging": {
    "LogLevel": {
      "Microsoft.EntityFrameworkCore.Database.Command": "Information"
    }
  }
}

版本更新记录

  • 1.6.2
    • 修复 DbContextOptions 创建时重复创建 ConsoleLoggerProvider 的资源泄漏风险,SQL 日志输出改由宿主应用 Logging 配置控制
  • 1.5.0
    • 适配Common.EFCore修改
  • 1.4.2
    • 支持老的creater、modifyer、modify_time
  • 1.4.1
    • 更新注入问题,释放IServiceProvider
  • 1.4.0
    • 调整目录
  • 1.4.0-beta3
    • IBaseRepository支持指定DbContext
    • 支持AddDbContextFactory
  • 1.4.0-beta2
    • 移除针对netstandard2.1版本的支持
  • 1.4.0-beta1
    • 支持.Net9
  • 1.3.0
    • 增加PostgreRepository继承自BaseRepository和IBaseRepository
    • 增加默认注入IUnitOfWork
  • 1.2.0
    • 移除工作单元注入
  • 1.1.2
    • 修复迁移的时候自定义配置未生效问题
  • 1.1.1
    • 移除Zack.EFCore.Batch.Sqlite_NET6包
  • 1.1.0
    • 升级包版本,支持.net6、.net7
  • 1.0.0-beta3
    • 升级包版本,支持.netstandard2.1和.net5以及.net6
  • 1.1.0-beta2
    • 增加非追踪
  • 1.0.0-beta1
    • 修改注入方法名称为AddEntityFramework
  • 0.0.3
    • 更新分页入参
  • 0.0.2
    • 封装简单方法
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 is compatible.  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 is compatible.  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.6.2 0 7/8/2026
1.6.1 96 6/27/2026
1.6.0 100 5/17/2026
1.5.0 129 2/9/2026
1.4.2 300 8/26/2025
1.4.1 184 8/17/2025
1.4.0 234 8/13/2025
1.4.0-beta3 208 8/12/2025
1.4.0-beta2 605 7/23/2025
1.4.0-beta1 176 3/1/2025
1.3.0 222 8/11/2024
1.2.0 323 5/14/2023
1.1.2 288 5/8/2023
1.1.1 319 5/3/2023
1.1.0 293 5/3/2023
1.0.0-beta3 320 9/8/2022
1.0.0-beta2 363 6/19/2022
0.0.3 542 12/16/2021
0.0.2 542 9/20/2021
0.0.1 544 9/19/2021