public ApiResponse ListAll() { VehicleMakeModelProcessor = new VehicleMakeModelProcessor(); Response = new ApiResponse(); try { VehicleMakeModelProcessor.Find(); Response.text = JsonConverter.JsonConverter.ObjToJson(VehicleMakeModelProcessor.Find()); Response.result = true; return(Response); } catch { Response.text = "Unfortunately something went wrong :("; Response.result = false; return(Response); } }
public ApiResponse FindByPK(long id) { VehicleMakeModelProcessor = new VehicleMakeModelProcessor(); Response = new ApiResponse(); try { VehicleMakeModelProcessor.Find(id); Response.text = "Account with this PK has been found" + Environment.NewLine + JsonConverter.JsonConverter.ObjToJson(VehicleMakeModelProcessor.Find(id)); Response.result = true; return(Response); } catch { Response.text = "An account with this id does not exist"; Response.result = false; return(Response); } }