public IList <Exam> GetList(Expression <Func <Exam, bool> > filter = null) { using (var context = new ExamSystemContext()) { return(filter == null ? context.Set <Exam>().ToList() : context.Set <Exam>().Where(filter).ToList()); } }
public Exam Get(Expression <Func <Exam, bool> > filter) { using (var context = new ExamSystemContext()) { return(context.Set <Exam>().SingleOrDefault(filter)); } }