using presence.Data.RemoteData.RemoteDatabase.DAO; using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace presence.Data.RemoteData.RemoteDatabase { public class RemoteDatabaseContext: DbContext { protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseNpgsql("Host = 45.67.56.214; Port = 5454; Username = user3; Database = user3; Password = VOTfZ8PQ"); } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity().HasKey(group => group.ID); modelBuilder.Entity().Property(group => group.ID).ValueGeneratedOnAdd(); modelBuilder.Entity().HasKey(user => user.UserID); modelBuilder.Entity().Property(user => user.UserID).ValueGeneratedOnAdd(); modelBuilder.Entity().HasKey(presence => new { presence.UserDaoUserId, presence.Date, presence.IsAttedance, presence.LessonNumber }); } public DbSet Groups { get; set; } public DbSet Users { get; set; } public DbSet PresencesDaos { get; set; } } }