Skip to content

Commit 4fcd381

Browse files
author
vp
committed
Refactor CoreDbContext to use C# 12 primary constructor
Refactored the `CoreDbContext` class to leverage the new C# 12 primary constructor syntax, simplifying the class definition and reducing boilerplate code. Updated XML documentation to include a `<remarks>` section for additional context. Removed the explicit constructor definition and its associated documentation as it is no longer needed. No changes were made to the `Customers` property.
1 parent 47e1875 commit 4fcd381

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

  • src/Modules/CoreModule/CoreModule.Infrastructure/EntityFramework

src/Modules/CoreModule/CoreModule.Infrastructure/EntityFramework/CoreDbContext.cs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,13 @@ namespace BridgingIT.DevKit.Examples.GettingStarted.Modules.CoreModule.Infrastru
1212
/// Application database context for the CoreModule.
1313
/// Provides access to domain aggregates persisted in the relational database and applies EF Core mappings from the current assembly.
1414
/// </summary>
15-
public class CoreDbContext : DbContext
15+
/// <remarks>
16+
/// Initializes a new instance of the <see cref="CoreDbContext"/> class.
17+
/// Configured via <see cref="DbContextOptions{AppDbContext}"/> dependency injection.
18+
/// </remarks>
19+
/// <param name="options">The database context options (provider, connection string, etc.).</param>
20+
public class CoreDbContext(DbContextOptions<CoreDbContext> options) : DbContext(options)
1621
{
17-
/// <summary>
18-
/// Initializes a new instance of the <see cref="CoreDbContext"/> class.
19-
/// Configured via <see cref="DbContextOptions{AppDbContext}"/> dependency injection.
20-
/// </summary>
21-
/// <param name="options">The database context options (provider, connection string, etc.).</param>
22-
public CoreDbContext(DbContextOptions<CoreDbContext> options)
23-
: base(options)
24-
{
25-
}
26-
2722
/// <summary>
2823
/// Gets or sets the <see cref="DbSet{TEntity}"/> for managing <see cref="Customer"/> entities.
2924
/// Represents the "Customers" table in the database.

0 commit comments

Comments
 (0)