29 lines
1.0 KiB
VB.net
29 lines
1.0 KiB
VB.net
Namespace Schemas.Orders
|
|
Public Class Helpers
|
|
Public Shared Function GetOrderHead(Of T)(pData As IMesoWebservice) As T
|
|
Dim oHead As T = pData.Items.
|
|
Where(Function(i) TypeOf i Is T).
|
|
FirstOrDefault()
|
|
Return oHead
|
|
End Function
|
|
|
|
Public Shared Sub SetOrderHead(Of T)(pData As IMesoWebservice, pUpdateFunction As Action(Of T))
|
|
Dim oHead As T = pData.Items.
|
|
Where(Function(i) TypeOf i Is T).
|
|
SetValue(Sub(pObject As T)
|
|
pUpdateFunction(pObject)
|
|
End Sub).
|
|
FirstOrDefault()
|
|
|
|
End Sub
|
|
|
|
Public Shared Function GetOrderPositions(Of T)(pData As IMesoWebservice) As List(Of T)
|
|
Dim oPositions As List(Of T) = pData.Items.
|
|
Where(Function(i) TypeOf i Is T).
|
|
Select(Of T)(Function(i) i).
|
|
ToList()
|
|
Return oPositions
|
|
End Function
|
|
End Class
|
|
End Namespace
|