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