示例#1
0
 private void ConfigureGrid()
 {
     using (var repo = new CarRepo())
     {
         //Build a LINQ query that gets back some data from the Inventory table
         gridInventory.ItemsSource = repo.GetAll().Select(x => new { x.CarId, x.Make, x.Color, x.CarNickName });
     }
 }
示例#2
0
 private static void PrintAllInventory()
 {
     using (var repo = new CarRepo())
     {
         foreach (Car c in repo.GetAll())
         {
             WriteLine(c);
         }
     }
 }
示例#3
0
        public IEnumerable <Car> GetNewestCars()
        {
            int _year = carRepository.GetAll().Max(x => x.year);

            return(carRepository.GetByCondition(z => z.year == _year));
        }