2024-11-03 01:20:30 +04:00
|
|
|
|
using EventVisitorDatabase.Entities;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
|
|
|
|
namespace EventVisitorDatabase
|
|
|
|
|
{
|
|
|
|
|
public class EventVisitorDbContext: DbContext
|
|
|
|
|
{
|
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
|
|
|
{
|
|
|
|
|
if (optionsBuilder.IsConfigured == false)
|
|
|
|
|
{
|
|
|
|
|
optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Database=EventVisitorBd;Username=postgres;Password=1234");
|
|
|
|
|
}
|
|
|
|
|
base.OnConfiguring(optionsBuilder);
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-03 10:18:08 +04:00
|
|
|
|
public virtual DbSet<VisitorEntity> Visitors { get; set; }
|
2024-11-03 01:20:30 +04:00
|
|
|
|
public virtual DbSet<OrganizerEntity> Organizers { get; set; }
|
|
|
|
|
public virtual DbSet<EventEntity> Events { get; set; }
|
2024-11-10 12:57:59 +04:00
|
|
|
|
public virtual DbSet<SentMessageEntity> SentMessages { get; set; }
|
2024-11-03 01:20:30 +04:00
|
|
|
|
}
|
|
|
|
|
}
|