PIbd-21_Yakovlev_M.G._CarRe.../CarRepairShop/CarRepairShopDatabaseImplement/CarRepairShopDatabase.cs

30 lines
1001 B
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CarRepairShopDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
namespace CarRepairShopDatabaseImplement
{
public class CarRepairShopDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if(optionsBuilder.IsConfigured == false)
{
2024-03-24 22:46:50 +04:00
optionsBuilder.UseSqlServer(@"Data Source=.\SQLEXPRESS;Initial Catalog=CarRapirShopDatabase;Integrated Security=True;MultipleActiveResultSets=True;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Component> Components { get; set; }
public virtual DbSet<Repair> Repairs { get; set; }
public virtual DbSet<RepairComponent> RepairComponents { get; set; }
public virtual DbSet<Order> Orders { get; set; }
}
}