25 lines
883 B
C#
Raw Normal View History

2024-02-02 11:10:52 +04:00
using Microsoft.EntityFrameworkCore;
2024-02-02 11:10:52 +04:00
namespace EkzamenDatabaseImplement
{
public class ConfectioneryDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
// Перед работой необходимо установить SQL Express
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"
Server = localhost\SQLEXPRESS;
2024-02-02 11:10:52 +04:00
Initial Catalog = EkzamenDatabaseFull;
Integrated Security = True;
MultipleActiveResultSets = True;
TrustServerCertificate = True");
}
base.OnConfiguring(optionsBuilder);
}
2024-02-02 11:10:52 +04:00
public virtual DbSet<Student> Students { set; get; }
public virtual DbSet<Group> Groups { set; get; }
}
}