Update to latest version and show additional features

This commit is contained in:
2026-07-29 13:25:23 +02:00
parent 25690690d0
commit e44f2e7380
20 changed files with 804 additions and 31 deletions
@@ -0,0 +1,44 @@
using GerstITS.Data.EntityFramework;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
namespace GerstITS.Examples.JobDashboard.Data;
/// <summary>
/// Configures <see cref="JobRunDbContext" /> to use the EF Core InMemory provider
/// (<c>UseInMemoryDatabase</c>) so the example runs with zero external database dependencies.
///
/// All contexts share the same named in-memory database, so records written by one job execution are
/// visible to the next. No migrations are involved - the InMemory provider creates the model on demand.
/// </summary>
public sealed class InMemoryDatabaseConfigurator : DatabaseConfiguratorBase
{
#region Constants
private const string DatabaseName = "GerstITS.Examples.JobRuns";
#endregion
#region Constructors
public InMemoryDatabaseConfigurator(IConfiguration configuration)
: base(configuration)
{
}
#endregion
#region DatabaseConfiguratorBase
public override void ConfigureModelCreating(ModelBuilder modelBuilder)
{
// JobRunEntity is mapped by convention; the InMemory provider needs no relational configuration.
}
protected override void ConfigureDatabase(DbContextOptionsBuilder optionsBuilder, string connectionString)
{
optionsBuilder.UseInMemoryDatabase(DatabaseName);
}
#endregion
}