Я хочу создать универсальный построитель запросов для entityframework. Следующему методу ObjectContext.ExecuteStoreQuery<TElement> Method (String, Object[])
я пытаюсь передать универсальные типы. То есть:
BindingSource mybindingSource = new BindingSource();
mybindingSource.DataSource =
con.ExecuteStoreQuery<**SomeMethod**(MyTypeName)>(
myperfectWorkingSql,
myperfectWorkingSqlsParams
);
Как я могу получить TElement из строки MyTypeName? Как должна быть моя функция SomeMethod ()? Или какие методы я должен использовать?
или следующий код тоже выдает ошибку? Вот я не прав?
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 !