'Linq dynamic Where clauses by string
i have some problem with universal method in C#, i have 4+ model classes like this:
public class Assortment{
public string Code { get; set; }
public string EANCode { get; set; }
public float Quantity { get; set; }
}
i want to create universal logic method liek this ->
public T GetItem<T>(int someInt, string expression) where T : class
{
return db.Set<T>().Where(expression).Select(x=>x);
}
is this posible?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
