35 lines
1.5 KiB
C#
35 lines
1.5 KiB
C#
using CarCenterDatabaseImplement.Models;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.Design;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace CarCenterDatabaseImplement
|
|
{
|
|
public class CarCenterDatabase : DbContext
|
|
{
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
if (optionsBuilder.IsConfigured == false)
|
|
{
|
|
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-18O8941\SQLEXPRESS;Initial Catalog=CarCenterDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
|
}
|
|
base.OnConfiguring(optionsBuilder);
|
|
}
|
|
public virtual DbSet<Employee> Employees { set; get; }
|
|
public virtual DbSet<Presale> Presales { set; get; }
|
|
public virtual DbSet<Car> Cars { set; get; }
|
|
public virtual DbSet<Sale> Sales { set; get; }
|
|
public virtual DbSet<PresaleCar> PresaleCars { set; get; }
|
|
public virtual DbSet<ConfigurationCar> ConfigurationCars { set; get; }
|
|
public virtual DbSet<Configuration> Configurations { set; get; }
|
|
public virtual DbSet<Boss> Bosses { set; get; }
|
|
public virtual DbSet<TypeOfJob> TypeOfJobs { set; get; }
|
|
public virtual DbSet<Receipt> Receipts { set; get; }
|
|
public virtual DbSet<TypeOfJobConfiguration> TypeOfJobConfigurations { set; get; }
|
|
}
|
|
}
|