示例#1
0
 public List <Brand> GetAll(Expression <Func <Brand, bool> > filter = null)
 {
     using (ReCarProjectContext context = new ReCarProjectContext())
     {
         return(filter == null?context.Set <Brand>().ToList()
                    : context.Set <Brand>().Where(filter).ToList());
     }
 }
示例#2
0
 public Brand Get(Expression <Func <Brand, bool> > filter)
 {
     using (ReCarProjectContext context = new ReCarProjectContext())
     {
         return(context.Set <Brand>().SingleOrDefault(filter));
     }
 }