Class Context
The database context for the bike data.
Namespace: UnderDeskBike.Models
Assembly: UnderDeskBike.Data.dll
Syntax
public class Context : DbContext
Properties
WorkoutEntries
Gets or sets the workout entries.
public DbSet<WorkoutEntry> WorkoutEntries { get; set; }
Property Type
DbSet<WorkoutEntry> |
Workouts
Gets or sets the workouts.
public DbSet<Workout> Workouts { get; set; }
Property Type
DbSet<Workout> |
Methods
OnConfiguring(DbContextOptionsBuilder)
This method configures the database (and other options) to be used for this context.
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
Parameters
Type | Name | Description |
---|---|---|
DbContextOptionsBuilder | optionsBuilder | A builder used to create or modify options for this context. |
SaveChanges()
Saves all changes made in this context to the database.
public override int SaveChanges()
Returns
Type | Description |
---|---|
Int32 | The number of state entries written to the database. |