I have a basic viewmodel list in VB:
Transaction Status (Blackbox)
Public Property TStatus() As IEnumerable(Of SelectListItem)
Get
Return t_status
End Get
Set(ByVal value As IEnumerable(Of SelectListItem))
t_status = value
End Set
End Property
Public Sub New()
Dim MyList As New List(Of SelectListItem)
MyList.Add(New SelectListItem With {.Value = "0", .Text = "-ALL-"})
MyList.Add(New SelectListItem With {.Value = "1", .Text = "Unprocessed"})
MyList.Add(New SelectListItem With {.Value = "3", .Text = "Processed"})
MyList.Add(New SelectListItem With {.Value = "2", .Text = "Rejected (Blackbox)"})
MyList.Add(New SelectListItem With {.Value = "4", .Text = "Rejected (Compass)"})
MyList.Add(New SelectListItem With {.Value = "5", .Text = "CAN (Cancelled)"})
MyList.Add(New SelectListItem With {.Value = "6", .Text = "CHG (Changed)"})
End Sub
Which I then basically want to pull through my controller to then expose to my view. In other instances of pulling dynamic data, I simply do something like:
Dim AccTypeList = (From m In _DB.LibAcctType Select m).ToList()
And then pass it to my view, but in the case where my list is static, can I use a similar method or is there a recommended way of pulling the "SelecteListItem" details through my controller.