30 lines
967 B
C#
30 lines
967 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=localhost;Port=5432;Database=PersonnelDepartment;Username=postgres;Password=adam200396789");
|
|||
|
}
|
|||
|
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; }
|
|||
|
}
|
|||
|
}
|