PIbd-42_Kashin_M.I_CPO_Cour.../Services/EmployeeContext.cs

17 lines
538 B
C#
Raw Normal View History

using Microsoft.EntityFrameworkCore;
using EmployeeManagementApp.Models;
namespace EmployeeManagementApp.Services
{
public class EmployeeContext : DbContext
{
public DbSet<Employee> Employees { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
// Используем MySQL вместо PostgreSQL
optionsBuilder.UseMySQL("Server=localhost;Port=3306;Database=EmployeeDB;User=root;Password=SuperSecretPasswork2003;");
}
}
}