PIbd-32_Bulatova_K.R._COP_10/COP/ClientsDatabaseImplement/ClientsDatabase.cs

22 lines
805 B
C#
Raw Normal View History

2024-10-29 09:22:02 +04:00
using Microsoft.EntityFrameworkCore;
using ClientsDatabaseImplement.Models;
using System.Collections.Generic;
using System.Data;
namespace ClientsDatabaseImplement
{
public class ClientsDatabase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-1DE5E8N\SQLEXPRESS;Initial Catalog=ClientsDatabase2;
Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Status> Statuses { set; get; }
public virtual DbSet<Client> Clients { set; get; }
}
}