Table of Contents

Database Settings

This page publishes the canonical database settings documentation used by the application model workflows.

Use this page for the canonical database settings shared by RecroGrid Framework application models.

BaseDbContext and connection selection

By default, RecroGrid Framework generates a BaseDbContext class and uses it for database operations.

It is recommended to derive the generated BaseDbContext from your own application DbContext when you want the RecroGrid Framework integration to live inside the application's wider data model.

Database initialization is required for RecroGrid Framework operation even when your custom database model is still minimal.

Configure connection strings

Add the connection strings and the default connection name to the application configuration.

"ConnectionStrings": {
  "SQLServer": "Server=(localdb)\\mssqllocaldb;Database=DATABASE_NAME;Trusted_Connection=True;MultipleActiveResultSets=false",
  "PostgreSQL": "Host=SERVER_NAME;Database=DATABASE_NAME;Username=USER_NAME;Password=PASSWORD;Command Timeout=15",
  "Oracle26": "Data Source=Oracle26ai:1521/free;User Id=C##USER_NAME;Password=PASSWORD"
}
"Recrovit": {
  "RecroGridFramework": {
    "DefaultConnectionName": "SQLServer"
  }
}

Initialize the database

Start the application and navigate to /RGF/Admin, then initialize the database.

After a successful initialization, the system can expose the available database tables and related framework metadata through the admin interface.

Custom DbContext

If the generated BaseDbContext should not be used directly, disable its generation and register your own DbContext instead.

<PropertyGroup>
  <RGFBaseDbContext>false</RGFBaseDbContext>
  <RGFCustomSql>false</RGFCustomSql>
</PropertyGroup>
builder.Services.AddDbContext<YourDbContext>(options =>
    options.UseSqlServer(RGDataContext.DefaultConnectionString));

app.UseRGF<YourDbContext>();

For existing databases, an EF Core model-first or reverse-engineered workflow is a valid starting point as long as the final DbContext ownership is clear.