Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .NET objects directly #20

Open
mgroves opened this issue Mar 22, 2018 · 1 comment
Open

Add .NET objects directly #20

mgroves opened this issue Mar 22, 2018 · 1 comment

Comments

@mgroves
Copy link

mgroves commented Mar 22, 2018

Maybe I'm missing something, but it would be helpful if I could add .NET objects directly to a data source instead of having to create a file, open a stream, and pass the stream. It would also be helpful to add more data to a dataset as needed (e.g. add a new piece of data to the dataset incrementally).

@vermeeca
Copy link
Member

If you can coerce your .NET objects into a Dictionary<string, string> for each instance, then you can indeed upload your data without writing it to a file first.

For example:

client.DataSets.Create(DataSet.From("my-dataset-name", new DataSetDetail() 
{
    Data = new List<Dictionary<string, string>() 
    {
         ["field1"] = "value1",
         ["field2"] = "value2"
    }
}));

..etc.

So, if you have a list of .Net objects already it'd be pretty straightforward to translate those objects into a DataSetDetail object and you'd be all set.

Of course, extending the .Net client to accept objects directly is probably a good idea. Ripe for a PR! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants