SUBD/TravelCompany/TravelCompanyDatabaseImplement/TravelCompanyDataBase.cs
2024-05-03 22:09:36 +04:00

22 lines
891 B
C#

using TravelCompanyDatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
namespace TravelCompanyDatabaseImplement
{
public class TravelCompanyDataBase : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder
optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=localhost\SQLEXPRESS;Initial Catalog=TravelCompanyDatabase;Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Component> Components { set; get; }
public virtual DbSet<Travel> Travels { set; get; }
public virtual DbSet<TravelComponent> TravelComponents { set; get; }
public virtual DbSet<Order> Orders { set; get; }
}
}