using Microsoft.EntityFrameworkCore; using Demo.Data.RemoteData.RemoteDataBase.DAO; using System; using System.Collections.Generic; using System.Linq; using System.Security.Cryptography.X509Certificates; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; 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=user15;Database=user15;Password=3XkvwMOb"); } 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 =>presence.PresenceId); modelBuilder.Entity().Property(presence=>presence.PresenceId).ValueGeneratedOnAdd(); } public DbSet Groups { get; set; } public DbSet Users { get; set; } public DbSet PresenceDaos { get; set; } } }