' Global Application Class
' Handles application-level events and initializes secure configuration.
' Connection strings come from env only (EnvConnectionStringsExpressionBuilder + db.GetConnectionString).
' We do not write to Web.config so the app runs on servers without config write permission.

Imports System.Web
Imports RGBC_Forecast

Namespace RGBC_Forecast

    Public Class Global_asax
        Inherits System.Web.HttpApplication

        ''' <summary>
        ''' Application startup - load .env / environment variables only.
        ''' No Web.config write; connection strings are provided at runtime from env.
        ''' </summary>
        Protected Sub Application_Start(sender As Object, e As EventArgs)
            SecureConfig.LoadEnvironmentVariables()
        End Sub

        Protected Sub Session_Start(sender As Object, e As EventArgs)
            ' Session start logic if needed
        End Sub

        Protected Sub Application_BeginRequest(sender As Object, e As EventArgs)
            ' Begin request logic if needed
        End Sub

        Protected Sub Application_AuthenticateRequest(sender As Object, e As EventArgs)
            ' Authentication logic if needed
        End Sub

        Protected Sub Application_Error(sender As Object, e As EventArgs)
            ' Error handling logic if needed
        End Sub

        Protected Sub Session_End(sender As Object, e As EventArgs)
            ' Session end logic if needed
        End Sub

        Protected Sub Application_End(sender As Object, e As EventArgs)
            ' Application end logic if needed
        End Sub

    End Class

End Namespace
