using Data.RemoteData.DAO; using Microsoft.EntityFrameworkCore; namespace data.RemoteData { public class RemoteDataBaseContext: DbContext { internal DbSet Group { get; set; } internal DbSet User { get; set; } internal DbSet Presence { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseNpgsql("Host=localhost;Username=postgres;Port=5432;Database=Presence;Password=123"); } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity().HasKey(group => group.Id); modelBuilder.Entity().HasKey(user => user.Guid); modelBuilder.Entity().HasKey(presence => new { presence.UserGuid, presence.IsAttedance, presence.Date, presence.LessonNumber, }); } } }