PIbd-23.Vrazhkin_S.A.RPP_ku.../AutoCenter/AutoCenterDatabaseImplement/AutoCenterDatabase.cs

33 lines
1.2 KiB
C#
Raw Normal View History

2024-05-01 19:29:21 +04:00
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AutoCenterDatabaseImplement.Models;
namespace AutoCenterDatabaseImplement
{
public class AutoCenterDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-K0U29OV;Initial Catalog=AutoCenter;Integrated Security=True;MultipleActiveResultSets=True;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<CarBrand> CarBrands { get; set; }
public virtual DbSet<PresellingWork> PresellingWorks { get; set; }
public virtual DbSet<Car> Cars { get; set; }
public virtual DbSet<Purchase> Purchases { get; set; }
public virtual DbSet<Shop> Shops{ set; get; }
public virtual DbSet<User> Users{ set; get; }
public virtual DbSet<Wish> Wishes { get; set; }
public virtual DbSet<Equipment> Equipments { get; set; }
}
}