Ejemplo n.º 1
0
 public List <Brand> GetAll(Expression <Func <Brand, bool> > filter = null)
 {
     using (RentACarContext rentACarContext = new RentACarContext())
     {
         return(filter == null?rentACarContext.Set <Brand>().ToList() : rentACarContext.Set <Brand>().Where(filter).ToList());
     }
 }
 public List <Color> GetAll(Expression <Func <Color, bool> > filter = null)
 {
     using (RentACarContext context = new RentACarContext())
     {
         return(filter == null?context.Set <Color>().ToList() :
                    context.Set <Color>().Where(filter).ToList());
     }
 }
 public Color Get(Expression <Func <Color, bool> > filter)
 {
     using (RentACarContext context = new RentACarContext())
     {
         return(context.Set <Color>().SingleOrDefault(filter));
     }
 }
Ejemplo n.º 4
0
 public Brand Get(Expression <Func <Brand, bool> > filter)
 {
     using (RentACarContext rentACarContext = new RentACarContext())
     {
         return(rentACarContext.Set <Brand>().SingleOrDefault(filter));
     }
 }