2023-10-21 00:15:53 +04:00
|
|
|
|
using DatabaseImplement.Models;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace DatabaseImplement
|
|
|
|
|
{
|
|
|
|
|
public class ElegevContext : DbContext
|
|
|
|
|
{
|
|
|
|
|
public DbSet<LabWork> LabWorks { get; set; }
|
|
|
|
|
|
2023-10-23 16:21:36 +04:00
|
|
|
|
public DbSet<Discipline> Disciplines { get; set; }
|
|
|
|
|
|
2023-10-21 00:15:53 +04:00
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
|
|
|
{
|
2023-10-23 16:21:36 +04:00
|
|
|
|
if (optionsBuilder.IsConfigured == false)
|
|
|
|
|
{
|
|
|
|
|
optionsBuilder.UseSqlServer(@"Data Source=MSI-B17;Initial Catalog=ElegevContext;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
|
|
|
|
}
|
2023-10-21 00:15:53 +04:00
|
|
|
|
|
|
|
|
|
base.OnConfiguring(optionsBuilder);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|