20 lines
752 B
C#
20 lines
752 B
C#
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace Tetris.Models;
|
|
|
|
/* "This class is a database context for the Score class."
|
|
|
|
The `DbSet<Score>` property is a collection of Score objects. The `OnConfiguring` method is used to configure the
|
|
database connection */
|
|
public class ScoreContext : DbContext {
|
|
public DbSet<Score> Scores { get; set; }
|
|
|
|
/// <summary>
|
|
/// It use SQLite and use the database file located at `.\Resources\db.sl3`.
|
|
/// </summary>
|
|
/// <param name="DbContextOptionsBuilder">This is the class that will be used to configure the DbContext.</param>
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
optionsBuilder.UseSqlite(@"Data Source=.\Resources\db.sl3");
|
|
}
|
|
}
|