using Microsoft.EntityFrameworkCore;
using SchoolDatabase.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SchoolDatabase
{
    public class SchoolDbContext : DbContext
	{
		protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
		{
			if (optionsBuilder.IsConfigured == false)
			{
				optionsBuilder.UseSqlServer
					(
					@"Data Source=localhost\SQLEXPRESS;
                    Initial Catalog=SchoolDataBase1;
                    Integrated Security=True;
                    MultipleActiveResultSets=True;
                    TrustServerCertificate=True"
					);
			}
			base.OnConfiguring(optionsBuilder);
		}
		public virtual DbSet<Custumer> Custumers { get; set; }
		public virtual DbSet<Item> Items { get; set; }
		public virtual DbSet<ItemForStudy> ItemForStudys { get; set; }
		public virtual DbSet<Study> Studys { get; set; }
		public virtual DbSet<Courses> Coursess { get; set; }
		public virtual DbSet<CoursesForStudy> CoursessForStudys { get; set; }
		public virtual DbSet<Worker> Workers { get; set; }
		public virtual DbSet<Payment> Payments { get; set; }
	}
}

