public async Task <IActionResult> Index(string tableId, string tableName) { ViewBag.TableName = tableName; ViewBag.TableId = tableId; TableFieldsResponse tableFieldsResponse = await TableRecordsAPIClient.GetFieldsForTables(tableId); return(View(tableFieldsResponse)); }
/// <summary> /// Retrieves the fields in a Tadabase table /// </summary> /// <param name="tableId">the table id on tadabase</param> /// <returns>TableFieldsResponse</returns> public async Task <TableFieldsResponse> GetFieldsForTables(string tableId) { string url = string.Format(Constants.FIELDS_IN_TABLE_URL, tableId); HttpResponseMessage httpResponseMessage = await HttpClient.GetAsync(url); TableFieldsResponse tableFieldsResponse = await ProcessResponse <TableFieldsResponse>(httpResponseMessage); return(tableFieldsResponse); }