EDMI: Add New Database methods
This commit is contained in:
@@ -115,6 +115,21 @@ Public Class Client
|
||||
End Try
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Aborts the channel and creates a new connection
|
||||
''' </summary>
|
||||
Public Sub Reconnect()
|
||||
_logger.Warn("Connection faulted. Trying to reconnect..")
|
||||
|
||||
Try
|
||||
_channel.Abort()
|
||||
_channel = GetChannel()
|
||||
_channel.Open()
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Imports a file from a filepath, creating a IDB ObjectId and Filesystem Object
|
||||
''' </summary>
|
||||
@@ -220,7 +235,6 @@ Public Class Client
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Sets a value to an attribute
|
||||
''' </summary>
|
||||
@@ -520,9 +534,13 @@ Public Class Client
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function GetDatatableFromIDB(SQL As String) As TableResult
|
||||
Public Function GetDatatableFromIDB(pSQL As String, Optional pConnectionId As Integer = 0) As GetDatatableResponse
|
||||
Try
|
||||
Dim oResponse = _channel.ReturnDatatable_MSSQL_IDB(SQL)
|
||||
Dim oResponse = _channel.ReturnDatatable(New GetDatatableRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.IDB,
|
||||
.ConnectionId = pConnectionId
|
||||
})
|
||||
Return oResponse
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
@@ -530,9 +548,13 @@ Public Class Client
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Async Function GetDatatableFromIDBAsync(SQL As String) As Task(Of TableResult)
|
||||
Public Async Function GetDatatableFromIDBAsync(pSQL As String, Optional pConnectionId As Integer = 0) As Task(Of GetDatatableResponse)
|
||||
Try
|
||||
Dim oResponse = Await _channel.ReturnDatatable_MSSQL_IDBAsync(SQL)
|
||||
Dim oResponse = Await _channel.ReturnDatatableAsync(New GetDatatableRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.IDB,
|
||||
.ConnectionId = pConnectionId
|
||||
})
|
||||
Return oResponse
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
@@ -540,9 +562,13 @@ Public Class Client
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function GetScalarValueFromIDB(SQL As String) As ScalarResult
|
||||
Public Function GetScalarValueFromIDB(pSQL As String, Optional pConnectionId As Integer = 0) As GetScalarValueResponse
|
||||
Try
|
||||
Dim oResponse = _channel.ReturnScalar_MSSQL_IDB(SQL)
|
||||
Dim oResponse = _channel.ReturnScalarValue(New GetScalarValueRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.IDB,
|
||||
.ConnectionId = pConnectionId
|
||||
})
|
||||
Return oResponse
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
@@ -550,9 +576,13 @@ Public Class Client
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Async Function GetScalarValueFromIDBAsync(SQL As String) As Task(Of ScalarResult)
|
||||
Public Async Function GetScalarValueFromIDBAsync(pSQL As String, Optional pConnectionId As Integer = 0) As Task(Of GetScalarValueResponse)
|
||||
Try
|
||||
Dim oResponse = Await _channel.ReturnScalar_MSSQL_IDBAsync(SQL)
|
||||
Dim oResponse = Await _channel.ReturnScalarValueAsync(New GetScalarValueRequest() With {
|
||||
.SqlCommand = pSQL,
|
||||
.NamedDatabase = DatabaseName.IDB,
|
||||
.ConnectionId = pConnectionId
|
||||
})
|
||||
Return oResponse
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
@@ -631,21 +661,8 @@ Public Class Client
|
||||
End Try
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' Aborts the channel and creates a new connection
|
||||
''' </summary>
|
||||
Public Sub Reconnect()
|
||||
_logger.Warn("Connection faulted. Trying to reconnect..")
|
||||
|
||||
Try
|
||||
_channel.Abort()
|
||||
_channel = GetChannel()
|
||||
_channel.Open()
|
||||
Catch ex As Exception
|
||||
_logger.Error(ex)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
#Region "Private Functions"
|
||||
''' <summary>
|
||||
''' Creates a channel and adds a Faulted-Handler
|
||||
''' </summary>
|
||||
@@ -671,8 +688,7 @@ Public Class Client
|
||||
Private Function GetUserName(pOverrideName) As String
|
||||
Return NotNull(pOverrideName, Environment.UserName)
|
||||
End Function
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "Response Classes"
|
||||
Public Class StreamedFile
|
||||
|
||||
Reference in New Issue
Block a user