NPv.Common.Infrastructure.Db.Ef
1.4.2
dotnet add package NPv.Common.Infrastructure.Db.Ef --version 1.4.2
NuGet\Install-Package NPv.Common.Infrastructure.Db.Ef -Version 1.4.2
<PackageReference Include="NPv.Common.Infrastructure.Db.Ef" Version="1.4.2" />
<PackageVersion Include="NPv.Common.Infrastructure.Db.Ef" Version="1.4.2" />
<PackageReference Include="NPv.Common.Infrastructure.Db.Ef" />
paket add NPv.Common.Infrastructure.Db.Ef --version 1.4.2
#r "nuget: NPv.Common.Infrastructure.Db.Ef, 1.4.2"
#:package NPv.Common.Infrastructure.Db.Ef@1.4.2
#addin nuget:?package=NPv.Common.Infrastructure.Db.Ef&version=1.4.2
#tool nuget:?package=NPv.Common.Infrastructure.Db.Ef&version=1.4.2
Simple Generic Repository Library
Brief Description
A foundational infrastructure library designed to streamline data access by providing an EF GenericRepository interface. This ensures consistent and standardized data access patterns across your application.
Getting Started
To integrate this library into your project, simply add a reference to it. Then, configure your DbContext and repositories as needed.
Quick Example
The following demonstrates how to create ApplicationContext:
public class ApplicationContext(DbContextOptions<ApplicationContext> options) : DbContext(options)
{
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
foreach (var entityType in builder.Model.GetEntityTypes()
.Where(t => t.ClrType.IsSubclassOf(typeof(Entity))))
{
var entity = builder.Entity(entityType.ClrType);
entity.Property("Id")
.ValueGeneratedOnAdd()
.HasValueGenerator<GuidV7ValueGenerator>();
}
UserMapping.ApplyMapping(builder);
//other mappings
DefaultString256MaxLengthMapping.ApplyMapping(builder);
}
}
Usage
When adding a new entity to the database, the Id will be automatically generated.
Changelog
2025-02-15 1.4.1-2
- remove obsolete code
- bugfixing
- refactoring
2025-02-15 1.3.
- broken version
2025-01-14 - Version 1.2.3
- include Version 1.2.2
- Add EFCoreGenericRepository, IUnitOfWorkProvider, PerRequestUnitOfWorkProvider
- Marked as [Obsolete]: PerRequestDbContextProvider, IDbContextProvider, ConsoleDbContextProvider, EfGenericRepository
2024-12-12 - Version 1.2.1
Add GuidV7ValueGenerator
2024-11-18 - Version 1.2.0
- Update to .Net 9
- Update dependencies
- Correct adding README.md
2024-11-12 - Version 1.1.0
- Add README file
- Update to .Net 8
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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. |
-
net9.0
- Autofac (>= 8.2.0)
- Microsoft.EntityFrameworkCore (>= 9.0.2)
- NPv.Common.Infrastructure.Db (>= 1.2.3)
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 |
---|