22 lines
764 B
C#
22 lines
764 B
C#
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace Demo.Data.RemoteData.RemoteDataBase
|
|
{
|
|
public class RemoteDatabase : DbContext
|
|
{
|
|
public DbSet<DAO.User> Users { get; set; }
|
|
public DbSet<DAO.Group> Groups { get; set; }
|
|
public DbSet<DAO.Presence> Presence { get; set; }
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
optionsBuilder.UseNpgsql("Host=45.67.56.214;Port=5421;Username=user5;Database=user5;Password=EtEJqhsf");
|
|
}
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
modelBuilder.Entity<DAO.Presence>()
|
|
.HasKey(p => p.Id); // Указание первичного ключа
|
|
}
|
|
}
|
|
} |