// GET api/<controller>/5
 public Vehicle Get(int id)
 {
     using (var manager = new VehicleManager())
     {
         return(manager.Get(id));
     }
 }
        public Slot Park(int id, [FromBody] string value)
        {
            Vehicle vehicle;

            using (var manager = new VehicleManager())
            {
                vehicle = manager.Get(id);
            }
            using (var manager = new SlotManager())
            {
                var allocatedSlot = manager.Park(vehicle);
                var json          = JsonConvert.SerializeObject(allocatedSlot, Formatting.Indented,
                                                                new JsonSerializerSettings
                {
                    ReferenceLoopHandling = ReferenceLoopHandling.Ignore
                });
                return(JsonConvert.DeserializeObject <Slot>(json));
            }
        }
Exemple #3
0
 public ActionResult GetEditVehicle(int id)
 {
     return(View(_VehcileManager.Get(id)));
 }