Imports System.Collections.Generic
Imports System.Data
Imports System.Threading.Tasks
Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Interfaces
Imports DigitalData.Modules.Logging

Public Class API_DEXSQLJob
    Inherits JobBase
    Implements IJob(Of APISQLArgs)

    Public Sub New(LogConfig As LogConfig, MSSQL As MSSQLServer)
        MyBase.New(LogConfig, MSSQL)
    End Sub

    Public Sub StartDex_API(Arguments As APISQLArgs) Implements IJob(Of APISQLArgs).Start
        Dim oJobName As String = [GetType]().Name

        Try
            _Logger.Info("Running job {0}", oJobName)


            _Logger.Info("Job {0} completed!", oJobName)
        Catch ex As Exception
            _Logger.Warn("Job {0} failed!", oJobName)
            _Logger.Error(ex)
        End Try
    End Sub

    Public Function ShouldStart(Arguments As APISQLArgs) As Boolean Implements IJob(Of APISQLArgs).ShouldStart
        Return Arguments.Enabled
    End Function


End Class
