public List <Car> GetAll(Expression <Func <Car, bool> > filter = null)
 {
     using (CarProjectDbContext context = new CarProjectDbContext())
     {
         return(filter == null
             ? context.Set <Car>().ToList()
             : context.Set <Car>().Where(filter).ToList());
     }
 }
 public Car Get(Expression <Func <Car, bool> > filter)
 {
     using (CarProjectDbContext context = new CarProjectDbContext())
     {
         return(context.Set <Car>().SingleOrDefault(filter));
     }
 }