using System; using System.Collections.Generic; using System.Data.Common; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using ServiceStationDatabaseImplement.Models; namespace ServiceStationDatabaseImplement { public class ServiceStationDatabase : DbContext { protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { if(optionsBuilder.IsConfigured == false) { optionsBuilder.UseSqlServer(@"Data Source=.\SQLEXPRESS;Initial Catalog=ServiceStationDatabase;Integrated Security=True;MultipleActiveResultSets=True;TrustServerCertificate=True"); } base.OnConfiguring(optionsBuilder); } public virtual DbSet Cars { get; set; } public virtual DbSet Defects { get; set; } public virtual DbSet CarDefects { get; set; } public virtual DbSet Executors { get; set; } public virtual DbSet TechnicalWorks { get; set; } public virtual DbSet CarTechnicalWorks { get; set; } } }