You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
785 B
27 lines
785 B
using DataBase.Entity;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace DataBase.Context
|
|
{
|
|
public class PongDbContext : DbContext
|
|
{
|
|
public DbSet<Player> Players { get; set; }
|
|
public DbSet<Game> Games { get; set; }
|
|
public DbSet<Message> Messages { get; set; }
|
|
public DbSet<Chat> Chats { get; set; }
|
|
|
|
public PongDbContext() { }
|
|
public PongDbContext(DbContextOptions<PongDbContext> options) : base(options) { }
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
//base.OnConfiguring(optionsBuilder);
|
|
|
|
if (!optionsBuilder.IsConfigured)
|
|
{
|
|
optionsBuilder.UseSqlite("Data Source=../DataBase/PongDB.db");
|
|
}
|
|
}
|
|
}
|
|
}
|