public DataController(IGenericRepository <Module> module, IGenericRepository <Result> result, ResultsGraphViewModel resultsGraphViewModel) { _module = module; _result = result; _resultsGraphViewModel = resultsGraphViewModel; }
public ActionResult Module(ResultsGraphViewModel resFilter) { //Gets the module selected by the user var res = _result.Get(m => m.moduleID == resFilter.moduleID, null, x => x.Module); //Save all modules names and the filtered module data to the ResultsGraphViewModel _resultsGraphViewModel.modules = _module.GetAll(x => x.OrderBy(r => r.moduleName)); _resultsGraphViewModel.Result = res; return(View(_resultsGraphViewModel)); }