Gismatullin.ISEbd-21.STO.Co.../ServiceStation/ServiceStationsDataBaseImplement/DataBase.cs

27 lines
1.1 KiB
C#
Raw Normal View History

2024-04-30 18:44:37 +04:00
using Microsoft.EntityFrameworkCore;
2024-04-30 20:55:37 +04:00
using ServiceStationsDataBaseImplement.Implements;
2024-04-30 18:44:37 +04:00
using ServiceStationsDataBaseImplement.Models;
using System.Collections.Generic;
using System.Data;
namespace ServiceStationsDataBaseImplement
{
public class Database : DbContext
{
2024-08-10 18:43:15 +04:00
//DESKTOP-E2VPEN3
//WIN-4HUIDGH3G02
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
2024-04-30 18:44:37 +04:00
{
if (optionsBuilder.IsConfigured == false)
{
2024-08-10 18:43:15 +04:00
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-E2VPEN3\SQLEXPRESS;Initial Catalog=ServiceStationDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
2024-04-30 18:44:37 +04:00
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Client> Clients { set; get; }
2024-08-10 18:43:15 +04:00
public virtual DbSet<WorkClient> WorksClients { set; get; }
2024-04-30 20:55:37 +04:00
public virtual DbSet<Executor> Executors { set; get; }
2024-08-10 18:43:15 +04:00
public virtual DbSet<TaskByWork> Tasks { set; get; }
2024-04-30 20:55:37 +04:00
public virtual DbSet<Work> Works { set; get; }
2024-04-30 18:44:37 +04:00
}
}