using data.RemoteData.RemoteDataBase.DAO; using Microsoft.EntityFrameworkCore; namespace remoteData.RemoteDataBase { public class RemoteDatabaseContext : DbContext { 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.Guid); modelBuilder.Entity().Property(user => user.Guid).ValueGeneratedOnAdd(); modelBuilder.Entity() .HasKey(presence => presence.Id); modelBuilder.Entity() .Property(presence => presence.Id) .ValueGeneratedOnAdd(); modelBuilder.Entity() .HasOne(presence => presence.User) .WithMany(user => user.Presences) .HasForeignKey(presence => presence.UserGuid); } public DbSet groups { get; set; } public DbSet users { get; set; } public DbSet presence { get; set; } } }