26 lines
974 B
C#
26 lines
974 B
C#
using ElectronicsShopDataBaseImplement.Models;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using System.Collections.Generic;
|
|
|
|
namespace ElectronicsShopDataBaseImplement
|
|
{
|
|
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; }
|
|
|
|
}
|
|
}
|