I know I can change a query like this
Dim myList As List(Of Tickets) = (From a In db.myTable Where a.ID = id AndAlso a.IsOnline = True).ToList
in lambda
Dim myList as List(of Tickets) = db.Where(Function(x) x.ID = id ANDAlso a.IsOnline = true).ToList
How to write a lambda version and tell her to create a new object with the results? eg:
Dim myList As List(Of Tickets) = (From a In db.myTable Where a.ID = id AndAlso a.IsOnline = True Select New TicketType With { .Id = a.rsID.ToString, .Title = a.rsTitle}).ToList
source share