using Microsoft.EntityFrameworkCore; using Posechaemost.Data.RemoteData.RemoteDataBase.DAO; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Posechaemost.Data.RemoteData.RemoteDataBase { public class RemoteDataBaseContext: DbContext { protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder){ optionsBuilder.UseNpgsql(); } 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 => new { presence.User, presence.Date, presence.IsAttendence, presence.ClassNumber }); } public DbSet groups{ get; set; } public DbSet users{ get; set; } public DbSet presences{ get; set; } } }