PIbd-22_Safiulova_K.N._Airc.../AircraftPlant/AircraftPlantDatabaseImplement/AircraftPlantDatabase.cs
2024-05-06 21:14:20 +04:00

30 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AircraftPlantDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
namespace AircraftPlantDatabaseImplement
{
public class AircraftPlantDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-6QDRI0N\SQLEXPRESS;Initial Catalog=AircraftPlantDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Component> Components { set; get; }
public virtual DbSet<Plane> Planes { set; get; }
public virtual DbSet<PlaneComponent> PlaneComponents { set; get; }
public virtual DbSet<Order> Orders { set; get; }
public virtual DbSet<Client> Clients { set; get; }
public virtual DbSet<Implementer> Implementers { set; get; }
}
}