configuration-entityframework - Configuration.EntityFramework 1.0.1.123

Configuration.EntityFramework is a custom configuration provider for the .NET Core Configuration system. It's built on EntityFrameworkCore allowing configuration settings to be stored in a wide variety of repositories

PM> Install-Package Configuration.EntityFramework -Version 1.0.1.123 -Source https://www.myget.org/F/configuration-entityframework/api/v3/index.json

Copy to clipboard

> nuget.exe install Configuration.EntityFramework -Version 1.0.1.123 -Source https://www.myget.org/F/configuration-entityframework/api/v3/index.json

Copy to clipboard

> dotnet add package Configuration.EntityFramework --version 1.0.1.123 --source https://www.myget.org/F/configuration-entityframework/api/v3/index.json

Copy to clipboard
<PackageReference Include="Configuration.EntityFramework" Version="1.0.1.123" />
Copy to clipboard
source https://www.myget.org/F/configuration-entityframework/api/v3/index.json

nuget Configuration.EntityFramework  ~> 1.0.1.123
Copy to clipboard

> choco install Configuration.EntityFramework --version 1.0.1.123 --source https://www.myget.org/F/configuration-entityframework/api/v2

Copy to clipboard
Import-Module PowerShellGet
Register-PSRepository -Name "configuration-entityframework" -SourceLocation "https://www.myget.org/F/configuration-entityframework/api/v2"
Install-Module -Name "Configuration.EntityFramework" -RequiredVersion "1.0.1.123" -Repository "configuration-entityframework" 
Copy to clipboard

onfiguration.EntityFramework

For .NET Framework & .NET Core

.NET Core supports a variety of different configuration options. Application configuration data can come from files using built-in support for JSON, XML, and INI formats, as well as from environment variables, command line arguments or even an in-memory collection. So why is there no support for EntityFramework? Well now there is!

Configuration.EntityFramework is a custom configuration provider for the .NET Core Configuration system. It's built on EntityFrameworkCore allowing configuration settings to be stored in a wide variety of repositories, including;

  • Microsoft SQL Server,
  • SQLite,
  • Npgsql (PostgreSQL),
  • MySQL (Official),
  • Pomelo (MySQL),
  • Microsoft SQL Server Compact Edition,
  • IBM Data Servers,
  • InMemory (for Testing),
  • Devart (MySQL, Oracle, PostgreSQL, SQLite, DB2, SQL Server, and more),
  • Oracle (Coming Soon).

Build Status

configuration-entityframework MyGet Build Status

So why use Configuration.EntityFramework?

Some settings, such as a connection string or those required during the initialisation of an application may be better located in a local file rather than a repository. However, in many cases Configuration.EntityFramework can present some distinct advantages, including;

  1. Makes use of the .NET Core configuration provider model,
  2. Support for complex types,
  3. Access settings in a strongly typed fashion using the [Options pattern] (https://docs.asp.net/en/latest/fundamentals/configuration.html#options-config-objects),
  4. Enhanced Configuration Management and Change Control. This is particularly relevant to a distributed environment,
  5. Transactional update of settings for whole of environment,
  6. Common settings can be shared among many applications. Support for single point of change,
  7. In a complex system with many related applications or services it's not uncommon to have many configuration files. By persisting settings to a database, the dependency on these configuration files can be reduced,
  8. All settings for a select criteria, such as environment, application or section can be retrieved with a single query,
  9. Allow end users to update settings via the EntityFramework Context.

Compatibility

Configuration.EntityFramework is compatible with netstandard2.0, net461 and net462.

How do I get started?

Our Sample Project demonstrates how to use Configuration.EntityFramework and gives you some starting points for learning more. Additionally, the Getting Started tutorial walks you through using Configuration.EntityFramework in a simple ASP.NET Core app.

Get Packages

You can get Configuration.EntityFramework by grabbing the latest NuGet package. If you're feeling adventurous, continuous integration builds are on MyGet.

Release notes are available on the wiki.

Get Help

Need help with Configuration.EntityFramework? We're ready to answer your questions on Stack Overflow. Alternatively ask a question here.

##Super-duper quick start

Create Configuration.EntityFramework database.

var options = new DbContextOptionsBuilder<ConfigurationContext>().UseSqlServer(
      @"Data Source=.;Initial Catalog=Configuration;Integrated Security=True").Options;

using (var context = new ConfigurationContext(options))
{
  context.Database.EnsureCreated();
}

Initialise Configuration.EntityFramework.

var config = new ConfigurationBuilder()
   .SetBasePath(Environment.CurrentDirectory)
   .AddJsonFile("appsettings.json", true, true)
   .AddEntityFrameworkConfig(builder => builder.UseSqlServer(@"Data Source=.;Initial Catalog=Configuration;Integrated Security=True"))
   .Build();

Check Configuration Section Exists.

var exists = config.SectionExists("SampleSection");

Get Configuration Section for complex type. Return null if section does not exist.

var section = config.TryGetSection<ComplexType>("SampleSection");

Get Configuration Section for complex type. Return default value if section does not exist.

var section = config.GetSection<ComplexType>("SampleSection");

Get Configuration Value for Key.

var setting = config.GetValue<string>("TestSetting");

Project

Initial Release

  • .NETFramework 4.6.1
    • Microsoft.EntityFrameworkCore.SqlServer (>= 2.1.1)
    • Microsoft.Extensions.Configuration.Json (>= 2.1.1)
    • Microsoft.Extensions.Options.ConfigurationExtensions (>= 2.1.1)
    • Newtonsoft.Json (>= 11.0.2)
  • .NETFramework 4.6.2
    • Microsoft.EntityFrameworkCore.SqlServer (>= 2.1.1)
    • Microsoft.Extensions.Configuration.Json (>= 2.1.1)
    • Microsoft.Extensions.Options.ConfigurationExtensions (>= 2.1.1)
    • Newtonsoft.Json (>= 11.0.2)
  • .NETStandard 2.0
    • Microsoft.EntityFrameworkCore.SqlServer (>= 2.1.1)
    • Microsoft.Extensions.Configuration.Json (>= 2.1.1)
    • Microsoft.Extensions.Options.ConfigurationExtensions (>= 2.1.1)
    • Newtonsoft.Json (>= 11.0.2)
  • .NETFramework 4.6.1: 4.6.1.0
  • .NETFramework 4.6.2: 4.6.2.0
  • .NETStandard 2.0: 2.0.0.0

Owners

ThinkAbout

Authors

Configuration.EntityFramework

Project URL

https://github.com/thinkabouthub/Configuration.EntityFramework

License

Unknown

Tags

Configuration.EntityFramework Configuration EntityFramework c# dotnetcore

Info

627 total downloads
71 downloads for version 1.0.1.123
Download (44.39 KB)
Found on the current feed only

Package history

Version Size Last updated Downloads Mirrored?
1.0.1.123 44.39 KB Thu, 05 Jul 2018 04:20:20 GMT 71
1.0.1.122 44.25 KB Fri, 11 May 2018 09:07:46 GMT 60
1.0.1.121 44.25 KB Fri, 11 May 2018 06:17:47 GMT 81
1.0.1.120 44.24 KB Fri, 11 May 2018 06:17:44 GMT 75
1.0.1.119 43.93 KB Fri, 11 May 2018 04:21:20 GMT 67
1.0.1.118 43.93 KB Sun, 06 May 2018 21:31:50 GMT 64
1.0.1.117 43.94 KB Sun, 06 May 2018 10:35:34 GMT 66
1.0.1.116 43.93 KB Fri, 16 Feb 2018 01:35:41 GMT 79
1.0.1.115 58.07 KB Sat, 10 Feb 2018 10:55:15 GMT 64