A quick way to create a class within a LINQ query to contain the results
The below shows how to construct a Class inline to the LINQ query. Very useful for method specific processing…..
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
Public Class YourClass Dim selectedMedias = From mt In _mediaTable Where _mediaTypes.Contains(mt.Item("type")) Select New SysMedia With { .Type = mt.Item("type"), .URL = mt.Item("media_Text"), .Region = mt.Item("region"), .MD5 = mt.Item("md5"), .Format = mt.Item("format") } For Each MedDr As SysMedia In selectedMedias debug.writeline(MedDr.Type) Next End Class Public Class SysMedia Public Type As String Public URL As String Public Region As String Public MD5 As String Public Format As String End Class |

Leave a Reply