MONSTER: Rename Monorepo to Modules, only keep Projects under Modules.*
This commit is contained in:
48
EDMIAPI/Modules/ZooFlow/GetFileObject.vb
Normal file
48
EDMIAPI/Modules/ZooFlow/GetFileObject.vb
Normal file
@@ -0,0 +1,48 @@
|
||||
Imports DigitalData.Modules.EDMI.API.EDMIServiceReference
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Namespace Modules.Zooflow
|
||||
Public Class GetFileObject
|
||||
Inherits BaseMethod
|
||||
|
||||
Public Sub New(pLogConfig As LogConfig, pChannel As IEDMIServiceChannel)
|
||||
MyBase.New(pLogConfig, pChannel)
|
||||
End Sub
|
||||
|
||||
Public Async Function RunAsync(pObjectId As Long, pLoadFileContents As Boolean) As Task(Of FileObject)
|
||||
Try
|
||||
Dim oParams = New GetFileObjectRequest With {
|
||||
.ObjectId = pObjectId,
|
||||
.LoadFileContents = pLoadFileContents
|
||||
}
|
||||
Dim oResult = Await Channel.GetFileObjectAsync(oParams)
|
||||
If oResult.OK Then
|
||||
Return oResult.FileObject
|
||||
Else
|
||||
Return Nothing
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function Run(pObjectId As Long, pLoadFileContents As Boolean) As FileObject
|
||||
Try
|
||||
Dim oParams = New GetFileObjectRequest With {
|
||||
.ObjectId = pObjectId,
|
||||
.LoadFileContents = pLoadFileContents
|
||||
}
|
||||
Dim oResult = Channel.GetFileObject(oParams)
|
||||
If oResult.OK Then
|
||||
Return oResult.FileObject
|
||||
Else
|
||||
Return Nothing
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
Reference in New Issue
Block a user