PIbd-22_Chubykina_SUBD_Book.../Bookshop/BookshopDatabaseImplement/BookshopDatabase.cs

31 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using BookshopDatabaseImplement.Models;
namespace BookshopDatabaseImplement
{
public class BookshopDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-0CI5KVE\SQLEXPRESS;Initial Catalog=BookshopDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Author> Authors { set; get; }
public virtual DbSet<Book> Books { set; get; }
public virtual DbSet<Genre> Genres { set; get; }
public virtual DbSet<Instance> Instances { set; get; }
public virtual DbSet<Order> Orders { set; get; }
public virtual DbSet<Publisher> Publishers { set; get; }
public virtual DbSet<Review> Reviews { set; get; }
public virtual DbSet<User> Users { set; get; }
}
}