public string GetCarById(string id) { Car carResult = carMethods.GetCarById(Convert.ToInt16(id)); string jsonCar = JsonConvert.SerializeObject(carResult); return(jsonCar); }
//////////////////////////////////////////////// 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)); }