PIbd-32_Artamonova_T.V._COP_2/UniversityDatabaseImplement/UniversityDatabase.cs

20 lines
757 B
C#

using Microsoft.EntityFrameworkCore;
using UniversityDatabaseImplement.Models;
namespace UniversityDatabaseImplement
{
public class UniversityDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-IHH1ICP\SQLEXPRESS;Initial Catalog=UniversityDatabaseFull;Integrated Security=True;MultipleActiveResultSets=True;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Student> Students { set; get; }
public virtual DbSet<Direction> Directions { set; get; }
}
}