public void StreamRowToPowerBI(PBIRow row, string apiKey, PBIAPIClient powerBiAPI = null) { if (ParentDataset == null) { throw new Exception("Cannot add row to PowerBI table as the table is not linked to a DataSet in PowerBI!"); } if (powerBiAPI == null) { if (ParentDataset.ParentPowerBIAPI == null) { throw new Exception("No PowerBI API Object was supplied!"); } else { powerBiAPI = ParentDataset.ParentPowerBIAPI; } } PBIRows rows = new PBIRows(); rows.ParentTable = this; rows.Rows = new List <PBIRow>(1); rows.Rows.Add(row); StreamRowsToPowerBI(rows, apiKey, powerBiAPI); }
public void PushRowToPowerBI(PBIRow row, PBIAPIClient powerBiAPI = null) { PBIRows rows = new PBIRows(); rows.ParentTable = this; rows.Rows = new List <PBIRow>(1); rows.Rows.Add(row); PushRowsToPowerBI(rows, powerBiAPI); }
public PBIRow GetSampleRow() { Dictionary <string, object> sample = new Dictionary <string, object>(Columns.Count); if (Columns != null) { foreach (PBIColumn col in Columns) { sample.Add(col.Name, null); } } PBIRow ret = new PBIRow(sample); ret.ParentTable = this; return(ret); }