﻿using Hangfire;
using Owin;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using Microsoft.Practices.Unity;

namespace SourceManager
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            BusinessLogic.Core.UnityConfig.InitContainer();

            GlobalConfiguration.Configuration
                .UseSqlServerStorage(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString);

            GlobalConfiguration.Configuration.UseActivator(new BusinessLogic.Core.UnityActivator(BusinessLogic.Core.UnityConfig.Container));

            app.UseHangfireDashboard();

            BusinessLogic.Core.UnityConfig.Container.Resolve<BusinessLogic.AutoMerge.Base.ISchedule>().Execute();
        }
    }
}