COP-17/WinFormsProject/DateBaseImplement/DBContext.cs

25 lines
753 B
C#
Raw Permalink Normal View History

2023-11-15 22:51:44 +04:00
using DateBaseImplement.Models;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace DateBaseImplement
{
public class DBContext : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (!optionsBuilder.IsConfigured)
2023-12-14 10:39:56 +04:00
optionsBuilder.UseNpgsql(@"Host=localhost;Port=5432;Database=COPArtyom;Username=courseuser;Password=courseuser");
2023-11-15 22:51:44 +04:00
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Provider> Providers { get; set; }
public virtual DbSet<Models.Type> Types { get; set; }
}
}