using Microsoft.EntityFrameworkCore; namespace Demo.Data.RemoteData.RemoteDataBase { public class RemoteDatabase : DbContext { public DbSet Users { get; set; } public DbSet Groups { get; set; } public DbSet Presence { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseNpgsql("Host=45.67.56.214;Port=5421;Username=user5;Database=user5;Password=EtEJqhsf"); } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity() .HasKey(p => p.Id); // Указание первичного ключа } } }