-
Notifications
You must be signed in to change notification settings - Fork 13
Home
.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).
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;
- Makes use of the .NET Core configuration provider model,
- Support for complex types,
- Access settings in a strongly typed fashion using the [Options pattern] (https://docs.asp.net/en/latest/fundamentals/configuration.html#options-config-objects),
- Enhanced Configuration Management and Change Control. This is particularly relevant to a distributed environment,
- Transactional update of settings for whole of environment,
- Common settings can be shared among many applications. Support for single point of change,
- 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,
- All settings for a select criteria, such as environment, application or section can be retrieved with a single query,
- Allow end users to update settings via the EntityFramework Context.
Configuration.EntityFramework is compatible with .NET Core and .NET 4.6.2 or greater.