SUBD/PersonnelDepartment/PersonnelDepartmentDatabaseImplement/PersonnelDepartmentDatabase.cs
2024-05-20 01:14:24 +04:00

30 lines
966 B
C#

using Microsoft.EntityFrameworkCore;
using PersonnelDepartmentDatabaseImplement.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Type = PersonnelDepartmentDatabaseImplement.Models.Type;
namespace PersonnelDepartmentDatabaseImplement
{
public class PersonnelDepartmentDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseNpgsql(@"Host=192.168.0.104;Port=5432;Database=PersonnelDepartment;Username=postgres;Password=postgres");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Deal> Deals { get; set; }
public virtual DbSet<Department> Departments { get; set; }
public virtual DbSet<Employee> Employees { get; set; }
public virtual DbSet<Position> Positions { get; set; }
public virtual DbSet<Type> Types { get; set; }
}
}