using Demo.Data.RemoteData.RemoteDataBase.DAO; using Microsoft.EntityFrameworkCore; namespace Demo.Data.RemoteData.RemoteDataBase { public class RemoteDatabaseContext: DbContext { protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseNpgsql("Host=45.67.56.214;Port=5421;Username=user11;Database=user11;Password=JSZHJyg1"); } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity().HasKey(group => group.Id); modelBuilder.Entity().Property(group => group.Id).ValueGeneratedOnAdd(); modelBuilder.Entity().HasKey(user => user.Guid); modelBuilder.Entity().Property(user => user.Guid).ValueGeneratedOnAdd(); modelBuilder.Entity().HasKey(presense => new { presense.UserGuid, presense.Date, presense.IsAttedance, presense.LessonNumber }); } public DbSet Groups { get; set; } public DbSet Users { get; set; } public DbSet PresenceDaos { get; set; } } }