using EntityFirst.Module.Interceptors;
using EntityFirst.Module.Migrations;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.SqlServer;
using System.Linq;
// namespaces...
namespace EntityFirst.Module.BusinessObjects
{
    // public classes...
    public class CustomDbConfiguration : DbConfiguration
    {
        // public constructors...
        public CustomDbConfiguration()
        {
            SetDatabaseInitializer(new MigrateDatabaseToLatestVersion<EntityFirstDbContext, Configuration>());
            SetExecutionStrategy("System.Data.SqlClient", () => new SqlAzureExecutionStrategy());

            AddInterceptor(new TenantCommandInterceptor());
            AddInterceptor(new TenantCommandTreeInterceptor());
        }
    }
}
