Database Infrastructure
- All databases that support Entity Framework Core can be used.
- It comes ready by default with InMemoryDb, PostgreSql and Microsoft SqlServer support.
- In addition to relational databases, it provides the opportunity to work with NoSQL databases with MongoDB support.
- For database versions that can work with Entity Framework Core, you can use the Entity Framework Core Providers link.
Providers in the solution#
| Provider | Context | Connection string key | Notes |
|---|---|---|---|
| InMemory | Business/Fakes/DArch/DArchInMemory.cs | DArchInMemory | Development and Docker profiles; no database required |
| PostgreSQL | ProjectDbContext (default) | DArchPgContext | Default for Staging and Production |
| Microsoft SqlServer | MsDbContext | DArchMsContext | Register MsDbContext instead of ProjectDbContext |
| Oracle | OracleDbContext | DArchOracleContext | Provider not referenced by default |
| MySQL | MySqlDbContext | DArchMySqlContext | Provider not referenced by default |
| MongoDB | MongoDbContext | MongoDbSettings | Document stores, logs and ElasticSearch-style data |
The context classes live under DataAccess/Concrete/EntityFramework/Contexts. ProjectDbContext
falls back to Npgsql in OnConfiguring when no provider is configured, which is why PostgreSQL is the
path of least resistance for a first deployment.
See Database Selection and Configuration for switching providers and Migration Management for creating migrations per provider.
authors: Kerem VARIŞ, Veli GÖRGÜLÜ