예제 #1
0
        public void Setup()
        {
            var sampleDB = JsonConvert.DeserializeObject <Vehicles>(Sampledata.VehiclesJson);



            _vehicleService = new JsonVehicleService(sampleDB);
            //_vehicleService = new JsonVehicleService(Sampledata.VehiclesJson);
            //The JsonVehicleService can NOT have any 'if', 'for', 'foreach', or 'while' statements
            //you must use 'where', 'select', 'selectmany', 'union' with lambas
        }
예제 #2
0
 public VehicleController()
 {
     if (_vehicleService == null)
     {
         _vehicleService = new JsonVehicleService(new Vehicles()
         {
             new Car()
             {
                 Name = "Accord", Cost = "$30,000"
             }
         });
     }
 }
예제 #3
0
 public VehicleController()
 {
     if (_vehicleService == null)
         _vehicleService = new JsonVehicleService(new Vehicles() { new Car() { Name = "Accord", Cost = "$30,000" } });
 }