I've create a query depending on a type chosen from a Combobox.
So is it possible to create a variable and then use it like this:
??? T = chosen_entity.GetType();
IQueryable
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Danatas GerviRank #4,152 · 361 reputationPosted Aug 4, 2009, 8:41 AM EDT
I think, not.
The reason – when you write code, C# syntax allow to use "T" as future concrete type.
But compiler must know, witch type it is now.
Type T = someObject.GetType();
T can get exact value only in runtime…
May be somebody will explain better then me…
Danatas GerviRank #4,152 · 361 reputationPosted Aug 5, 2009, 6:32 AM EDT
May be this is what you want....