I have a class that extends the System.Web.UI.WebControls.GridView control. I want to have a property that can save my EF expression to use throughout the control.
Problem is, T is not defined.
public sealed class NCGridView : GridView
{
private Expression<Func<T, bool>> _where;
public void LoadWhere(Expression<Func<T, bool>> where)
{
_where = where;
}
}
RedHat suggestion attempt
private Expression<Func<BaseModel, bool>> _where;
public void LoadWhere<T>(Expression<Func<T, bool>> where) where T : BaseModel
{
// Cannot cast from: Expression<Func<T, bool>> to: Expression<Func<BaseModel, bool>>
_where = where;
}