Forum Discussion
Anonymous
5 years agoNot applicable
PostRows not working with package Microsoft.PowerBi.Api
I was able to get the rest APIs working quickly in C#. The code works fine without any errors or exceptions, but the PostRows ( ) method didn't seem to work. The dataset, table, and columns get c...
- Anonymous5 years ago
Further investigation revealed that the sdk doesn't handle serialization of anonymous types and silently blanks them out.
As an example, this can be overcome/verified by specifying serialization settings as below.
PowerBiClient.SerializationSettings.ContractResolver = new DefaultContractResolver(); //anonymous types serialize to blank {} without this await PowerBiClient.Datasets.PostRowsAsync(dataset.Id, tableName, postRows);The sdk doesn't have great documentation - almost none actually.
Anonymous
5 years agoNot applicable
Further investigation revealed that the sdk doesn't handle serialization of anonymous types and silently blanks them out.
As an example, this can be overcome/verified by specifying serialization settings as below.
PowerBiClient.SerializationSettings.ContractResolver = new DefaultContractResolver(); //anonymous types serialize to blank {} without this
await PowerBiClient.Datasets.PostRowsAsync(dataset.Id, tableName, postRows);
The sdk doesn't have great documentation - almost none actually.
- Anonymous5 years agoNot applicable
I was wondering why it was not working... seems like we have to go see the internal code.