I want to create a generic query builder to entityframework. To the following method ObjectContext.ExecuteStoreQuery<TElement> Method (String, Object[])
I am trying to pass generic types. That is :
BindingSource mybindingSource = new BindingSource();
mybindingSource.DataSource =
con.ExecuteStoreQuery<**SomeMethod**(MyTypeName)>(
myperfectWorkingSql,
myperfectWorkingSqlsParams
);
How can I get TElement from string MyTypeName? How should be my SomeMethod() function? Or which methods should I use?
or the following code also gives error? Here am I wrong ?
function fooo ( Type t) {
BindingSource mybindingSource = new BindingSource();
mybindingSource.DataSource =
con.ExecuteStoreQuery<t>(
myperfectWorkingSql,
myperfectWorkingSqlsParams
);
}
ERROR: this gives type t or namespace t can not be found !