public IEnumerable <Assessment> GetAllAassessments(Func <Assessment, bool> pFunc = null) { try { if (pFunc == null) { return(dal.GetAllAassessments()); } else { return((from asses in dal.GetAllAassessments() where pFunc(asses) select asses).ToList()); } } catch (Exception ex) { MessageBox.Show(ex.Message); return(null); } }