using Microsoft.EntityFrameworkCore;
using Demo.Data.RemoteData.RemoteDataBase.DAO;

namespace Demo.Data.RemoteData.RemoteDataBase
{
    public class RemoteDatabaseContext : DbContext
    {
        public DbSet<User> Users { get; set; }
        public DbSet<Group> Groups { get; set; }
        public DbSet<Presence> Presence { get; set; }

        public RemoteDatabaseContext(DbContextOptions<RemoteDatabaseContext> options) : base(options)
        {
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Presence>()
                .HasKey(p => p.Id); // Указание первичного ключа

            modelBuilder.Entity<Group>()
                .HasKey(g => g.Id); // Указание первичного ключа
        }
    }
}