28 lines
1.0 KiB
C#
28 lines
1.0 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
using System.Collections.Generic;
|
|
|
|
namespace ElectronicsShopDataBaseImplement
|
|
{
|
|
public class DataBase
|
|
{
|
|
public class Database : DbContext
|
|
{
|
|
protected override void OnConfiguring(DbContextOptionsBuilder
|
|
optionsBuilder)
|
|
{
|
|
if (optionsBuilder.IsConfigured == false)
|
|
{
|
|
optionsBuilder.UseSqlServer(@"Data Source=.\SQLEXPRESS;Initial Catalog=ZooDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
|
|
}
|
|
base.OnConfiguring(optionsBuilder);
|
|
}
|
|
public virtual DbSet<CategoryProduct> CategoryProducts { set; get; }
|
|
public virtual DbSet<User> Users { set; get; }
|
|
public virtual DbSet<Route> Routes { set; get; }
|
|
public virtual DbSet<RoutePreserve> RoutePreserves { set; get; }
|
|
public virtual DbSet<Preserve> Preserves { set; get; }
|
|
|
|
}
|
|
}
|
|
}
|