28 lines
810 B
C#
28 lines
810 B
C#
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; }
|
|
|
|
public DbSet<Discipline> Disciplines { get; set; }
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
if (optionsBuilder.IsConfigured == false)
|
|
{
|
|
optionsBuilder.UseSqlServer(@"Data Source=MSI-B17;Initial Catalog=ElegevContext;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
|
}
|
|
|
|
base.OnConfiguring(optionsBuilder);
|
|
}
|
|
}
|
|
}
|