Archived
1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
Tetris/Tetris/Models/ScoreContext.cs
2022-06-08 09:14:30 +02:00

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");
}
}