Aparyan.ISE-22.MotorPlant/Aparyan.ISE_22.MotorPlant/MotorPlantDatabaseImplement/MotorPlantDatabase.cs

24 lines
950 B
C#

using Microsoft.EntityFrameworkCore;
using MotorPlantDatabaseImplement.Models;
namespace MotorPlantDatabaseImplement
{
public class MotorPlantDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=WIN-QKNE49D1RUQ\SQLEXPRESS;Initial Catalog=MotorPlantDatabaseeses;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Component> Components { set; get; }
public virtual DbSet<Engine> Engines { set; get; }
public virtual DbSet<EngineComponent> EngineComponents { set; get; }
public virtual DbSet<Order> Orders { set; get; }
public virtual DbSet<Client> Clients { set; get; }
}
}