public string GetCarById(string id)
        {
            Car    carResult = carMethods.GetCarById(Convert.ToInt16(id));
            string jsonCar   = JsonConvert.SerializeObject(carResult);

            return(jsonCar);
        }
Exemplo n.º 3
0
 //////////////////////////////////////////////// CAR METHODS
 public CarInfo GetCarById(CarRequest manager)
 {
     if (manager.LicenseKey != "hemligt")
     {
         throw new WebFaultException <string>(
                   "Wrong license key", HttpStatusCode.Forbidden);
     }
     else
     {
         return(carMethods.GetCarById(manager.Id));
     }
 }
 public Car GetCarById(int id)
 {
     return(carMethods.GetCarById(id));
 }