PIbd-32_Chubykina_P.P._COP_11/COP/ClientDataBaseImplement/ClientsDatabase.cs

27 lines
886 B
C#
Raw Permalink Normal View History

2024-10-28 14:54:01 +04:00
using Microsoft.EntityFrameworkCore;
using ClientDataBaseImplement.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;
namespace ClientDataBaseImplement
{
public class ClientsDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-0CI5KVE\SQLEXPRESS;Initial Catalog=ClientDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Client> Clients { set; get; }
public virtual DbSet<Category> Categories { set; get; }
}
}