public void DeleteRowsFromPowerBI(PBIAPIClient powerBiAPI = null) { if (ParentDataset == null) { throw new Exception("Cannot delete rows from PowerBI table as the table is not linked to a DataSet in PowerBI!"); } if (Name == null) { throw new Exception("Cannot add row to PowerBI table as the table does not have a name!"); } if (powerBiAPI == null) { if (ParentDataset.ParentPowerBIAPI == null) { throw new Exception("No PowerBI API Object was supplied!"); } else { powerBiAPI = ParentDataset.ParentPowerBIAPI; } } using (HttpWebResponse response = powerBiAPI.SendDELETERequest(ApiURL, PBIAPI.Rows)) { string result = response.ResponseToString(); } }
public void DeleteFromPowerBI(PBIAPIClient powerBiAPI) { using (HttpWebResponse response = powerBiAPI.SendDELETERequest(ApiURL)) { using (StreamReader streamReader = new StreamReader(response.GetResponseStream(), true)) { string json = streamReader.ReadToEnd(); } } }