using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL.EFconfiguration;
using Domain;
using Microsoft.Win32;

namespace DAL
{
    public class DataBaseContext : DbContext
    {
        public DataBaseContext()
            : base("DbConnectionString")
        {
            Database.SetInitializer(new DropCreateDatabaseAlways<DataBaseContext>());
        }


        public DbSet<User> Users { get; set; }
        public DbSet<Customer> Customers { get; set; }
        public DbSet<Image> Images { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            modelBuilder.Configurations.Add(new EFCustomerConfiguration());
            modelBuilder.Configurations.Add(new EFImageConfiguration());
            
        }
    }
}
