2024-10-06 17:23:42 +04:00
|
|
|
|
using DatabaseImplement.Models;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
|
|
|
|
namespace DatabaseImplement
|
|
|
|
|
{
|
|
|
|
|
public class Database : DbContext
|
|
|
|
|
{
|
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
|
|
|
{
|
|
|
|
|
if (optionsBuilder.IsConfigured == false)
|
|
|
|
|
{
|
2024-11-05 22:56:43 +04:00
|
|
|
|
optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS;Initial Catalog=EnterpriseDataBase;Integrated Security=True;MultipleActiveResultSets=True; TrustServerCertificate=True");
|
2024-10-06 17:23:42 +04:00
|
|
|
|
}
|
|
|
|
|
base.OnConfiguring(optionsBuilder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual DbSet<Provider> Providers { get; set; }
|
|
|
|
|
public virtual DbSet<OrganisationType> OrganisationTypes { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|