Entity framework createquery question.
- by Tony Heflin
I am trying to create a generic search form to use in an EF app. I want to be ably to specify the entity to query at runtime below is a simplified version of the code.
cx is the contect object, valuelists is the entity in question.
1: Dim q As String = "select c from intactentities.valuelists as c"
2: Dim x = cx.CreateQuery(Of ValueLists)(q)
3: TextBox1.Text = x.Count
This works but I need to remove the hardcoded reference to valuelists in line 3. I expect I am overlooking something simple can anyone suggest a simple solution?
Thanks
Tony