using Microsoft.EntityFrameworkCore; using Zurnal.RemaDateBase.DateDao; public class RemoteDateBaseContext : DbContext { public DbSet Group { get; set; } public DbSet User { get; set; } public DbSet Presence { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseNpgsql("Host=45.67.56.214;Port=5421;Username=user16;Password=dZ28IVE5;Database=user16"); } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity().HasKey(group => group.Id); modelBuilder.Entity().Property(group => group.Id).ValueGeneratedOnAdd(); modelBuilder.Entity().HasKey(user => user.UserGuid); modelBuilder.Entity().Property(user => user.UserGuid).ValueGeneratedOnAdd(); modelBuilder.Entity().HasKey(presence => new { presence.UserGuid, presence.Date, presence.IsAttendensy, presence.LessonNumber }); } }