CourseWorkElectronicsShop/ElectronicsShop/ElectronicsShopDataBaseImplement/DataBase.cs
Илья Федотов 02d78da38f fixed 0.5
2024-04-29 00:44:49 +04:00

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; }
}
}