AppDbContext
Namespace: Commissiestrijd.Data
Assembly: backend.dll
Represents the application's database context. This context is used to interact with the database and manage the application's data. It includes DbSet properties for each entity type in the application, such as PossibleTasks, SubmittedTasks, Committees, and Periods. The context is configured to use Entity Framework Core for database operations.
public class AppDbContext : DbContext, IInfrastructure<IServiceProvider>, IDbContextDependencies, IDbSetCache, IDbContextPoolable, IResettableService, IDisposable, IAsyncDisposable
Inheritance
object
← DbContext
← AppDbContext
Implements
IInfrastructure<IServiceProvider>,
IDbContextDependencies
,
IDbSetCache
,
IDbContextPoolable
,
IResettableService
,
IDisposable
,
IAsyncDisposable
Show Inherited Members (54)
Constructors
AppDbContext(DbContextOptions<AppDbContext>)
Initializes a new instance of the AppDbContext class with the specified options. This constructor is used to set up the database context with the provided options, allowing for configuration of the database connection and other settings.
public AppDbContext(DbContextOptions<AppDbContext> options)
Parameters
Name | Type | Description |
---|---|---|
options | DbContextOptions<AppDbContext> | The options used to configure the database context. |
Properties
Committees
This property represents the set of committees in the application. It is used to query and save instances of the Committee entity in the database.
public DbSet<Committee> Committees { get; set; }
Property Value
Periods
This property represents the set of periods in the application. It is used to query and save instances of the Period entity in the database.
public DbSet<Period> Periods { get; set; }
Property Value
PossibleTasks
This property represents the set of possible tasks that can be submitted. It is used to query and save instances of the PossibleTask entity in the database.
public DbSet<PossibleTask> PossibleTasks { get; set; }
Property Value
DbSet
<PossibleTask
>
SubmittedTasks
This property represents the set of submitted tasks in the application. It is used to query and save instances of the SubmittedTask entity in the database.
public DbSet<SubmittedTask> SubmittedTasks { get; set; }
Property Value
DbSet
<SubmittedTask
>
Methods
OnModelCreating(ModelBuilder)
Configures the model for the application. This method is called by the Entity Framework Core runtime to configure the model and set up the relationships between entities, indexes, and other configurations. It is used to define the database schema and constraints for the application's data.
protected override void OnModelCreating(ModelBuilder modelBuilder)
Parameters
Name | Type | Description |
---|---|---|
modelBuilder | ModelBuilder | The model builder used to configure the model. |