All the examples I've seen for LINQ declare and assign a query at the same time. However, I'd like to declare my query, and then, depending on a condition, build the query separately.
I assume the "gotcha" on this has to do with anonymous types, but it seems like there should be some way to assign the query an "anonymous" value.
What I'd like to do is the following (obviously, the "<enumerable type>" data type doesn't work, I think that's what needs fixing?)
Dim dc As New UserDataContext
Dim q As New <enumerable type>
If CheckBox1.Checked = True Then
q = From iterVar In dc.vwAllEmail _
q = From iterVar In dc.vwAllEmailType _
Where iterVar.EmailType = intEmailType