Linger.EFCore
0.7.2
See the version list below for details.
dotnet add package Linger.EFCore --version 0.7.2
NuGet\Install-Package Linger.EFCore -Version 0.7.2
<PackageReference Include="Linger.EFCore" Version="0.7.2" />
<PackageVersion Include="Linger.EFCore" Version="0.7.2" />
<PackageReference Include="Linger.EFCore" />
paket add Linger.EFCore --version 0.7.2
#r "nuget: Linger.EFCore, 0.7.2"
#:package Linger.EFCore@0.7.2
#addin nuget:?package=Linger.EFCore&version=0.7.2
#tool nuget:?package=Linger.EFCore&version=0.7.2
Linger.EFCore
A C# Entity Framework Core helper library that provides enhanced query filter capabilities and property conversion extensions for .NET 9.0 and .NET 8.0.
Introduction
Linger.EFCore extends Entity Framework Core with powerful features including global query filters and property type conversions, making it easier to work with complex data types and filtering scenarios.
Features
Global Query Filters
- Apply filters automatically to entities implementing specific interfaces
- Apply filters based on property values
- Type-safe filter expressions
- Supports all Entity Framework Core query scenarios
Property Conversions
- JSON serialization support for complex types
- Conversion for string collections
- Custom value comparers
- Flexible configuration options
Usage Examples
JSON Property Conversion
public class User
{
public int Id { get; set; }
public UserSettings? Settings { get; set; }
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<User>().Property(x => x.Settings).HasJsonConversion();
}
String Collection Conversion
public class Product
{
public int Id { get; set; }
public ICollection? Tags { get; set; }
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Product>().Property(x => x.Tags).HasStringCollectionConversion(separator: ",");
}
Interface-based Filtering
// Define your interface
public interface ISoftDelete { bool IsDeleted { get; set; } }
// Implement the interface in your entities
public class User : ISoftDelete
{
public int Id { get; set; }
public string Name { get; set; }
public bool IsDeleted { get; set; }
}
// Apply the filter in your DbContext
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
// This will automatically filter out soft-deleted entities
modelBuilder.ApplyGlobalFilters<ISoftDelete>(e => !e.IsDeleted);
}
Property-based Filtering
// Multi-tenant filtering example
public class ApplicationDbContext : DbContext
{
private readonly int _currentTenantId;
public ApplicationDbContext(int currentTenantId)
{
_currentTenantId = currentTenantId;
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
// This will automatically filter entities by tenant
modelBuilder.ApplyGlobalFilters("TenantId", _currentTenantId);
}
}
Install
From Visual Studio
- Open the
Solution Explorer
. - Right-click on a project within your solution.
- Click on
Manage NuGet Packages...
. - Click on the
Browse
tab and search for "Linger.EFCore". - Click on the
Linger.EFCore
package, select the appropriate version and click Install.
Package Manager Console
PM> Install-Package Linger.EFCore
.NET CLI Console
> dotnet add package Linger.EFCore
Product | Versions 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. |
-
net8.0
- Linger.Utils (>= 0.7.2)
- Microsoft.EntityFrameworkCore (>= 9.0.5)
-
net9.0
- Linger.Utils (>= 0.7.2)
- Microsoft.EntityFrameworkCore (>= 9.0.5)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Linger.EFCore:
Package | Downloads |
---|---|
Linger.EFCore.Audit
An Entity Framework Core audit trail library for automatically tracking data changes. Captures entity creation, modification, and deletion events with old and new values. Provides configurable audit logging with support for user tracking and timestamping. |
|
Linger.Audit.EFCore
C# Helper Library |
|
Linger.Repository.EFCore
C# Helper Library |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
0.9.1-preview | 0 | 9/16/2025 |
0.9.0-preview | 59 | 9/12/2025 |
0.8.5-preview | 144 | 8/31/2025 |
0.8.4-preview | 267 | 8/25/2025 |
0.8.3-preview | 132 | 8/20/2025 |
0.8.2-preview | 159 | 8/4/2025 |
0.8.1-preview | 95 | 7/30/2025 |
0.8.0-preview | 516 | 7/22/2025 |
0.7.2 | 164 | 6/3/2025 |
0.7.1 | 161 | 5/21/2025 |
0.7.0 | 166 | 5/19/2025 |
0.6.0-alpha | 165 | 4/28/2025 |
0.5.0-alpha | 160 | 4/10/2025 |
0.4.0-alpha | 163 | 4/1/2025 |
0.3.3-alpha | 163 | 3/19/2025 |
0.3.2-alpha | 159 | 3/17/2025 |
0.3.1-alpha | 145 | 3/16/2025 |
0.3.0-alpha | 215 | 3/6/2025 |
0.2.0-alpha | 107 | 2/9/2025 |
0.1.2-alpha | 99 | 12/17/2024 |
0.1.1-alpha | 104 | 12/9/2024 |
0.1.0-alpha | 97 | 12/6/2024 |
0.0.4-alpha | 91 | 12/6/2024 |
0.0.3-alpha | 100 | 11/27/2024 |
0.0.2-alpha | 92 | 10/3/2024 |
0.0.1-alpha | 93 | 9/28/2024 |