22 lines
932 B
C#
22 lines
932 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=(localdb)\MSSQLLocalDB;Initial Catalog=master;Integrated Security=True;Connect Timeout=30;Encrypt=False;Trust Server Certificate=False;Application Intent=ReadWrite;Multi Subnet Failover=False");
|
|||
|
}
|
|||
|
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; }
|
|||
|
}
|
|||
|
}
|