DRN.Framework.EntityFramework
                              
                            
                                0.3.1-preview001
                            
                        
                            
                                
                                
                                    Prefix Reserved
                                
                            
                    See the version list below for details.
dotnet add package DRN.Framework.EntityFramework --version 0.3.1-preview001
NuGet\Install-Package DRN.Framework.EntityFramework -Version 0.3.1-preview001
<PackageReference Include="DRN.Framework.EntityFramework" Version="0.3.1-preview001" />
<PackageVersion Include="DRN.Framework.EntityFramework" Version="0.3.1-preview001" />
<PackageReference Include="DRN.Framework.EntityFramework" />
paket add DRN.Framework.EntityFramework --version 0.3.1-preview001
#r "nuget: DRN.Framework.EntityFramework, 0.3.1-preview001"
#:package DRN.Framework.EntityFramework@0.3.1-preview001
#addin nuget:?package=DRN.Framework.EntityFramework&version=0.3.1-preview001&prerelease
#tool nuget:?package=DRN.Framework.EntityFramework&version=0.3.1-preview001&prerelease
DRN.Framework.EntityFramework provides DrnContext with conventions to develop rapid and effective domain models.
DRNContext
DrnContext has following unique features:
- Implements IDesignTimeDbContextFactoryto enable migrations from dbContext defining projects.
- Implements IDesignTimeServicesto support multi context projects with default output directories in the context specific folder.
- Uses HasDrnContextServiceCollectionModuleattribute for automatic registration with AddServicesWithAttributes service collection extension method.
- Uses context name (typeof(TContext).Name) as connection string key by convention.
- Automatically applies IEntityTypeConfigurationimplementations from the assembly whose namespace contains the derived context's namespace.
- Automatically marks Entities derived from DRN.Framework.SharedKernel.Domain.Entityas created, modified or deleted.
- Enables DRN.Framework.Testingto create easy and effective integration tests with conventions and automatic registrations.- Application modules can be registered without any modification to TestContext
- TestContext's- ContainerContext- creates a postgresql containerthen scans TestContext's service collection for inherited DrnContexts.
- Adds a connection strings to TestContext's configuration for each DrnContextaccording to convention.
 
- creates a 
- TestContextacts as a ServiceProvider and when a service is requested it can build it from service collection with all dependencies.
 
- Application modules can be registered without any modification to 
namespace DRN.Framework.EntityFramework.Context;
[HasDrnContextServiceCollectionModule]
public abstract class DrnContext<TContext> : DbContext, IDesignTimeDbContextFactory<TContext>, IDesignTimeServices where TContext : DbContext, new()
{ 
...
public class HasDrnContextServiceCollectionModuleAttribute : HasServiceCollectionModuleAttribute
{
    static HasDrnContextServiceCollectionModuleAttribute()
    {
        ModuleMethodInfo = typeof(ServiceCollectionExtensions).GetMethod(nameof(ServiceCollectionExtensions.AddDbContextsWithConventions))!;
    }
}
Example Usage
namespace Sample.Infra;
public static class InfraModule
{
    public static IServiceCollection AddSampleInfraServices(this IServiceCollection sc)
    {
        sc.AddServicesWithAttributes();
        return sc;
    }
}
public class QAContext : DrnContext<QAContext>
{
    public QAContext(DbContextOptions<QAContext> options) : base(options)
    {
    }
    public QAContext() : base(null)
    {
    }
    public DbSet<User> Users { get; set; }
    public DbSet<Question> Questions { get; set; }
    public DbSet<Answer> Answers { get; set; }
    public DbSet<QuestionComment> Comments { get; set; }
    public DbSet<Category> Categories { get; set; }
    public DbSet<Tag> Tags { get; set; }
}
Development Environment Configurations
Following configuration options added to minimize development environment creation efforts:
- DrnContext development connection string will be auto generated when
- Environmentconfiguration key set as Development and,
- postgres-passwordconfiguration key set and,
- No other connection string is provided for the DbContexts.
 
- Following keys can set optionally according to DbContextConventions;
- DrnContext_AutoMigrateDevEnvironment- When set true applies migrations automatically
 
- DrnContext_DevHost- default is postgresql
 
- DrnContext_DevPort- default is 5432
 
- DrnContext_DevUsername- default is postgres
 
- DrnContext_DevDatabase- default is drnDb
 
 
postgres-password and DrnContext_AutoMigrateDevEnvironment should be enough to start a hosted service that has DrnContext dependencies.
For instance:
- When a Postgresql helm chart is used for dev environment and it creates a password secret automatically,
- Then only defining a volume mount should be enough for database configuration.
Global Usings
global using DRN.Framework.EntityFramework.Context;
global using Microsoft.EntityFrameworkCore;
global using DRN.Framework.Utils.DependencyInjection;
Semper Progredi: Always Progressive
Commit Info
Author: Duran Serkan KILIÇ
Date: 2024-04-26 22:25:03 +0300
Hash: 78c248b466d683535c681fd169a893cdfdf1ca55
| 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 was computed. 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- DRN.Framework.Utils (>= 0.3.1-preview001)
- EFCore.NamingConventions (>= 8.0.3)
- Microsoft.AspNetCore.Identity.EntityFrameworkCore (>= 8.0.4)
- Microsoft.EntityFrameworkCore.Tools (>= 8.0.4)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 8.0.2)
 
NuGet packages (1)
Showing the top 1 NuGet packages that depend on DRN.Framework.EntityFramework:
| Package | Downloads | 
|---|---|
| DRN.Framework.Testing DRN.Framework.Testing package encapsulates testing dependencies and provides practical, effective helpers such as resourceful data attributes and test context. This package enables a new encouraging testing technique called as DTT(Duran's Testing Technique). With DTT, any developer can write clean and hassle-free unit and integration tests without complexity. ## Commit Info Author: Duran Serkan KILIÇ Date: 2025-10-29 17:07:37 +0300 Hash: 6ba2247b447d9190a6ae70f8d616e566986abbc3 | 
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | 
|---|---|---|
| 0.7.0-preview042 | 34 | 10/29/2025 | 
| 0.7.0-preview041 | 88 | 10/25/2025 | 
| 0.7.0-preview040 | 152 | 10/12/2025 | 
| 0.7.0-preview039 | 107 | 10/11/2025 | 
| 0.7.0-preview038 | 171 | 10/8/2025 | 
| 0.7.0-preview037 | 172 | 9/28/2025 | 
| 0.7.0-preview036 | 193 | 9/22/2025 | 
| 0.7.0-preview035 | 183 | 8/31/2025 | 
| 0.7.0-preview034 | 203 | 8/31/2025 | 
| 0.7.0-preview033 | 218 | 8/28/2025 | 
| 0.7.0-preview032 | 217 | 8/27/2025 | 
| 0.7.0-preview031 | 198 | 8/10/2025 | 
| 0.7.0-preview030 | 73 | 8/1/2025 | 
| 0.7.0-preview029 | 91 | 8/1/2025 | 
| 0.7.0-preview028 | 91 | 8/1/2025 | 
| 0.7.0-preview027 | 126 | 7/31/2025 | 
| 0.7.0-preview026 | 121 | 7/29/2025 | 
| 0.7.0-preview025 | 135 | 7/27/2025 | 
| 0.7.0-preview024 | 115 | 7/11/2025 | 
| 0.7.0-preview023 | 117 | 7/11/2025 | 
| 0.7.0-preview022 | 186 | 6/29/2025 | 
| 0.7.0-preview021 | 177 | 6/23/2025 | 
| 0.7.0-preview020 | 136 | 5/31/2025 | 
| 0.7.0-preview019 | 222 | 3/23/2025 | 
| 0.7.0-preview018 | 163 | 3/2/2025 | 
| 0.7.0-preview017 | 153 | 2/23/2025 | 
| 0.7.0-preview016 | 161 | 2/22/2025 | 
| 0.7.0-preview015 | 129 | 2/21/2025 | 
| 0.7.0-preview014 | 147 | 2/20/2025 | 
| 0.7.0-preview013 | 166 | 2/9/2025 | 
| 0.7.0-preview012 | 140 | 2/8/2025 | 
| 0.7.0-preview011 | 143 | 2/2/2025 | 
| 0.7.0-preview010 | 136 | 1/20/2025 | 
| 0.7.0-preview009 | 146 | 1/19/2025 | 
| 0.7.0-preview008 | 110 | 1/16/2025 | 
| 0.7.0-preview007 | 151 | 12/29/2024 | 
| 0.7.0-preview006 | 129 | 12/23/2024 | 
| 0.7.0-preview005 | 140 | 11/27/2024 | 
| 0.7.0-preview004 | 152 | 11/23/2024 | 
| 0.7.0-preview003 | 137 | 11/20/2024 | 
| 0.7.0-preview002 | 147 | 11/17/2024 | 
| 0.7.0-preview001 | 155 | 11/14/2024 | 
| 0.6.0 | 188 | 11/10/2024 | 
| 0.6.0-preview002 | 145 | 11/10/2024 | 
| 0.6.0-preview001 | 159 | 11/10/2024 | 
| 0.5.1-preview002 | 149 | 9/30/2024 | 
| 0.5.1-preview001 | 137 | 9/22/2024 | 
| 0.5.0 | 207 | 8/30/2024 | 
| 0.5.0-preview011 | 136 | 8/30/2024 | 
| 0.5.0-preview010 | 165 | 8/25/2024 | 
| 0.5.0-preview009 | 161 | 8/8/2024 | 
| 0.5.0-preview008 | 153 | 8/7/2024 | 
| 0.5.0-preview007 | 132 | 8/2/2024 | 
| 0.5.0-preview006 | 117 | 7/30/2024 | 
| 0.5.0-preview005 | 150 | 7/27/2024 | 
| 0.5.0-preview004 | 157 | 7/15/2024 | 
| 0.5.0-preview003 | 176 | 6/6/2024 | 
| 0.5.0-preview002 | 151 | 6/5/2024 | 
| 0.5.0-preview001 | 158 | 6/4/2024 | 
| 0.4.0 | 161 | 5/19/2024 | 
| 0.4.0-preview006 | 156 | 5/19/2024 | 
| 0.4.0-preview005 | 184 | 5/12/2024 | 
| 0.4.0-preview004 | 169 | 5/12/2024 | 
| 0.4.0-preview003 | 153 | 5/11/2024 | 
| 0.4.0-preview002 | 167 | 5/8/2024 | 
| 0.4.0-preview001 | 183 | 5/5/2024 | 
| 0.3.1-preview001 | 138 | 4/26/2024 | 
| 0.3.0 | 188 | 4/23/2024 | 
| 0.3.0-preview002 | 154 | 4/23/2024 | 
| 0.3.0-preview001 | 160 | 4/23/2024 | 
| 0.2.2-preview010 | 178 | 4/11/2024 | 
| 0.2.2-preview009 | 145 | 3/18/2024 | 
| 0.2.2-preview008 | 144 | 3/18/2024 | 
| 0.2.2-preview007 | 157 | 3/16/2024 | 
| 0.2.2-preview006 | 135 | 3/11/2024 | 
| 0.2.2-preview005 | 155 | 3/10/2024 | 
| 0.2.2-preview004 | 160 | 3/10/2024 | 
| 0.2.2-preview003 | 230 | 1/22/2024 | 
| 0.2.2-preview002 | 156 | 1/18/2024 | 
| 0.2.2-preview001 | 180 | 1/14/2024 | 
| 0.2.1 | 266 | 1/7/2024 | 
| 0.2.0 | 167 | 12/31/2023 | 
| 0.2.0-preview009 | 134 | 12/31/2023 | 
| 0.2.0-preview008 | 118 | 12/30/2023 | 
| 0.2.0-preview007 | 125 | 12/28/2023 | 
| 0.2.0-preview006 | 133 | 12/27/2023 | 
| 0.2.0-preview005 | 114 | 12/25/2023 | 
| 0.2.0-preview004 | 124 | 12/23/2023 | 
| 0.2.0-preview003 | 125 | 12/20/2023 | 
| 0.2.0-preview002 | 116 | 12/19/2023 | 
Not every version includes changes, features or bug fixes. This project can increment version to keep consistency with other DRN.Framework projects.
## Version 0.3.0
My family celebrates the enduring legacy of Mustafa Kemal Atatürk's enlightenment ideals. This release is dedicated to 23 April National Sovereignty and Children's Day.
### Breaking Changes
### New Features
* DrnContext development connection string will be auto generated when
    * Environment configuration key set as Development and,
    * postgres-password configuration key set and,
    * No other connection string is provided for the DbContexts.
* Following keys can set optionally according to DbContextConventions;
    * DrnContext_AutoMigrateDevEnvironment
        * When set true applies migrations automatically
    * DrnContext_DevHost
    * DrnContext_DevPort
    * DrnContext_DevUsername
        * default is postgres
    * DrnContext_DevDatabase
        * default is drnDb
### Bug Fixes
## Version 0.2.0
### Breaking Changes
### New Features
* DrnContext added
    * Implemented IDesignTimeDbContextFactory to enable migrations from dbContext defining projects.
    * Implemented IDesignTimeServices to support multi context projects with default output directory in the context specific folder.
    * Uses HasDrnContextServiceCollectionModule to automatic registration with AddServicesWithAttributes service collection extension method.
    * Uses context name (typeof(TContext).Name) as connection string key by convention.
    * Enables DRN.Framework.Testing to create easy and effective integration tests with conventions and automatic registrations.
### Bug Fixes
---
**Semper Progredi: Always Progressive**  
  
## Commit Info  
Author: Duran Serkan KILIÇ  
Date: 2024-04-26 22:25:03 +0300  
Hash: 78c248b466d683535c681fd169a893cdfdf1ca55