22 lines
805 B
C#
22 lines
805 B
C#
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; }
|
|
}
|
|
} |