Skip to main content

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#

ProviderContextConnection string keyNotes
InMemoryBusiness/Fakes/DArch/DArchInMemory.csDArchInMemoryDevelopment and Docker profiles; no database required
PostgreSQLProjectDbContext (default)DArchPgContextDefault for Staging and Production
Microsoft SqlServerMsDbContextDArchMsContextRegister MsDbContext instead of ProjectDbContext
OracleOracleDbContextDArchOracleContextProvider not referenced by default
MySQLMySqlDbContextDArchMySqlContextProvider not referenced by default
MongoDBMongoDbContextMongoDbSettingsDocument 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Ü