1
I’m having difficulty to perform a query with LINQ using Generics.
Something like:
from x in session.Query<T>() " ??? "
My method takes two strings as parameters, Column and valueBack.
public virtual object PesquisePorColunaValor(string colunaDeBusca, string valorDeBusca)
{
// TODO Query em LINQ
}
You want to do a dynamic search according to the value passed by the right parameter?
– Jéf Bueno
??? Tell us what your question is. Explain what is happening, what you want to get at, give context to what you are doing. There’s a lot of nonsense played.
– Maniero
@Pedro Explain your question better, I believe that what Voce wants is to create a method that runs a dynamic query to be searched in a Collections, if that is it, I find it difficult to do this using the column name as String.
– Julio Borges
This Jéferson, is a method that serves for all entities. The search is according to the column name and the value sent by string.
– Pedro
from x in Session. Query<T>() select x returns all T records
– Pedro
@Julioborges The problem is that I can’t escape this pattern of the method. Because there is already a lot working with it.
– Pedro
I will implement without the use of Generics for now. I appreciate the attention of all.
– Pedro