using Knots.Models;
using Microsoft.EntityFrameworkCore;

namespace Knots;

public class KnotsDbContext : DbContext
{
    public DbSet<Discussion> Discussions { get; set; }
    public DbSet<Group> Groups { get; set; }
    public DbSet<Key> Keys { get; set; }
    public DbSet<Message> Messages { get; set; }
    public DbSet<Role> Roles { get; set; }
    public DbSet<User> Users { get; set; }

    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
        //Infos de connexion à la base de données
        string connectionString =
            "Server=romaric-thibault.fr;" +
            "Database=Knots;" +
            "User Id=mathieu;" +
            "Password=Onto9-Cage-Afflicted;" +
            "TrustServerCertificate=true;";

        optionsBuilder.UseSqlServer(connectionString);
    }

    protected override void OnModelCreating(ModelBuilder modelBuilder)

    {
        //Données à insérer
    }
}