30 lines
1001 B
C#
30 lines
1001 B
C#
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)
|
|
{
|
|
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; }
|
|
}
|
|
} |