I'm making a simple filter, and display the data on the page.
The code I'm using is this:
mt.ModelItens = db.Forecast
.Where(f => (f.CanalForecast.area == idArea && f.CanalForecast.despesa == idDespesa))
.ToPagedList(mt.ModelPaging.page, mt.ModelPaging.pageSizeSelected);
This code works great if the two fields are selected, because if only one is selected it does not show anything.
Referring here:
.Where(f => (f.CanalForecast.area == idArea && f.CanalForecast.despesa == idDespesa))
My problem is that I want it to work by selecting an ex field. (Area) and also works by selecting the two fields (Area and Expense).
I do not know if I was able to get past the real problem.