public string GetTripsForList(Int16 carid, int offset) { try { DBController dbc = new DBController(); List<Trip> trips = dbc.GetTripsForListByCarId(carid, offset); dbc.Close(); return JsonConvert.SerializeObject(trips); } catch (Exception e) { Console.WriteLine(e.ToString()); DBController dbc = new DBController(); dbc.AddLog("GetTripsForList?carid={carid}&offset={offset}", carid, null, null, e.ToString().Substring(0, Math.Min(e.ToString().Count(), 254)), offset.ToString()); dbc.Close(); } return ""; }