using data.DAO; using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace data { public class RemoteDatabaseContext: DbContext { protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseNpgsql("Host=localhost;port=5432;Password=admin;Username=postgres;Database=semesterWork"); } public DbSet groups { get; set; } public DbSet users { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity().HasKey(it => it.Guid); modelBuilder.Entity().HasKey(it => it.Id); modelBuilder.Entity().Property(it => it.Guid).ValueGeneratedOnAdd(); modelBuilder.Entity().Property(it => it.Id).ValueGeneratedOnAdd(); } } }