27 lines
1.1 KiB
C#
27 lines
1.1 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
using ServiceStationsDataBaseImplement.Implements;
|
|
using ServiceStationsDataBaseImplement.Models;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
|
|
namespace ServiceStationsDataBaseImplement
|
|
{
|
|
public class Database : DbContext
|
|
{
|
|
//DESKTOP-E2VPEN3
|
|
//WIN-4HUIDGH3G02
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
if (optionsBuilder.IsConfigured == false)
|
|
{
|
|
optionsBuilder.UseSqlServer(@"Data Source=WIN-4HUIDGH3G02\SQLEXPRESS;Initial Catalog=ServiceStationDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
|
}
|
|
base.OnConfiguring(optionsBuilder);
|
|
}
|
|
public virtual DbSet<Client> Clients { set; get; }
|
|
public virtual DbSet<WorkClient> WorksClients { set; get; }
|
|
public virtual DbSet<Executor> Executors { set; get; }
|
|
public virtual DbSet<TaskByWork> Tasks { set; get; }
|
|
public virtual DbSet<Work> Works { set; get; }
|
|
}
|
|
} |