ISEbd-21_Melnikov_I.O._CarS.../CarService/CarServiceDatabase/CarServiceDbContext.cs

34 lines
1.1 KiB
C#
Raw Normal View History

using CarServiceDatabase.Models;
using Microsoft.EntityFrameworkCore;
namespace CarServiceDatabase
{
public class CarServiceDbContext : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer
(
@"Data Source=IGORS_2011;
Initial Catalog=CarServiceDatabase;
Integrated Security=True;
MultipleActiveResultSets=True;
TrustServerCertificate=True"
);
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Customer> Customers { get; set; }
public virtual DbSet<Item> Items { get; set; }
public virtual DbSet<ItemForRepair> ItemsForRepair { get; set; }
public virtual DbSet<RepairRequest> RepairRequests { get; set; }
public virtual DbSet<Vehicle> Vehicles { get; set; }
public virtual DbSet<Work> Works { get; set; }
public virtual DbSet<Worker> Workers { get; set; }
public virtual DbSet<WorkInRequest> WorksInRequest { get; set; }
public virtual DbSet<WorkPayment> WorkPayments { get; set; }
}
}