-
Notifications
You must be signed in to change notification settings - Fork 14
Adding Azure Table storage and ComosDB table provider #5
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
Conversation
Jinhuafei
commented
Aug 13, 2018
- Add provider for Azure table storage and CosmosDB table
- Update outputcache async module
if (reader.Read()) { | ||
if ((DateTime)reader["UtcExpiry"] > DateTime.Now.ToUniversalTime()) { | ||
return BinarySerializer.Deserialize((byte[])reader["Value"]); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be sync or async operation? I see #region mentions "private sync method".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is sync code. Previous code causes deadlock under asp.net syncronizationcontext.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this apply to all the comments below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes.
using (var connection = new SqlConnection(ConnectionString)) { | ||
SqlExecuteNonQuery(connection, cmd); | ||
} | ||
return entry; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one too, change from Async to sync now, it this intended?
} | ||
|
||
private bool DoesKeyExist(string key) { | ||
return DoesKeyExistAsync(key).GetAwaiter().GetResult(); | ||
using (var cmd = CreateDoesKeyExistCommand(key)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
} | ||
|
||
private void RemoveEntry(string key) { | ||
RemoveEntryAsync(key).GetAwaiter().GetResult(); | ||
using (var cmd = CreateRemoveEntryCommand(key)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
} | ||
|
||
private void UpdateEntry(string key, object entry, DateTime utcExpiry) { | ||
UpdateEntryAsync(key, entry, utcExpiry).GetAwaiter().GetResult(); | ||
using (var cmd = CreateUpdateEntryCommand(key, entry, utcExpiry)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one more