Azure-Samples / event-hubs-dotnet-import-from-sql

Simple cloud app that pulls incremental records from a SQL Azure table and pushes to event hub
MIT License
31 stars 29 forks source link

The given key was not present in the dictionary. [error] #5

Open Srini98493 opened 6 years ago

Srini98493 commented 6 years ago

Hi,

Thanks for this code snippet. And, it worked very well for me with one exception. I have modified below lines and it worked.

[Original code line]

  IEnumerable<Dictionary<string, object>> orderedByOffsetKey =
                            resultCollection.OrderBy(r => r[offsetKey]);

[Modified code line]

    IEnumerable<Dictionary<string, object>> orderedByOffsetKey =
                            resultCollection.OrderBy(r => r[r.Keys.ElementAt(0)]);