using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Routing;
using Hangfire;

namespace DigitalSchoolApi
{
    public class WebApiApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            System.Web.Http.GlobalConfiguration.Configure(WebApiConfig.Register);
            Hangfire.GlobalConfiguration.Configuration.UseSqlServerStorage(ConfigurationManager.ConnectionStrings["hangfireString"].ConnectionString);
        }
        protected void Application_PreSendRequestHeaders(object sender, EventArgs e)
        {
            if (sender is HttpApplication app)
            {
                app.Context.Response.Headers.Remove("Server");
            }
        }
    }
}
