Exemplo n.º 1
0
 public List <CarVM> GetCars()
 {
     using (var db = new Lead2OrderGenerateDbEntities())
     {
         List <l2g_tbl_Car> cars = db.l2g_tbl_Car.ToList();
         if (cars.Count > 0)
         {
             List <CarVM> carVMs = new List <CarVM>();
             foreach (var car in cars)
             {
                 carVMs.Add(MappingConfig.CarToBusinessEntity(car));
             }
             return(carVMs);
         }
         return(new List <CarVM>());
     }
 }