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

TableSet.Add(entities) doesn't work properly. #29

Closed
hakotaro opened this issue Oct 25, 2013 · 2 comments
Closed

TableSet.Add(entities) doesn't work properly. #29

hakotaro opened this issue Oct 25, 2013 · 2 comments
Labels

Comments

@hakotaro
Copy link

Hi

TableSet.Add(entities) doesn't seems to work properly, even through TableSet.AddAsync(entities) work well.

Example Code I test is below

string connectionString = "UseDevelopmentStorage=true"; // change to your connectionString
string tableName = "testTableName";
CloudStorageAccount account = CloudStorageAccount.Parse(connectionString);
CloudTableClient tableClient = account.CreateCloudTableClient();
tableClient.GetTableReference(tableName).CreateIfNotExists();
TableSet tset = new TableSet(tableClient,tableName);

tset.AddAsync(deList); // work
tset.Add(deList); //doesn't work

If there are some mistakes I made, please let me know.

@dtretyakov
Copy link
Owner

Hello, thanks for posting it'll be fixed in the next version.

@dtretyakov
Copy link
Owner

Please note that TableSet.Add() method returns IEnumerable which is a deferred result.
So to execute insert operation you should enumerate result items like that:

tset.AddAsync(deList); // work, because it's not a deferred
tset.Add(deList).ToList(); // should work

If you have other questions feel free to communicate.

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

No branches or pull requests

2 participants