Skip to content

Commit

Permalink
Code review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Marusyk committed Jun 14, 2020
1 parent 4f5cdbf commit 2a41afe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,21 +278,20 @@ public override long GetServiceProviderHashCode()
{
if (_serviceProviderHash == null)
{
int hashCode;
if (!string.IsNullOrEmpty(Extension._connectionString))
{
var hashCode = Extension._connectionString.GetHashCode();
hashCode = (hashCode * 397) ^ (Extension._region?.GetHashCode() ?? 0);
hashCode = (hashCode * 397) ^ (Extension._connectionMode?.GetHashCode() ?? 0);
_serviceProviderHash = hashCode;
hashCode = Extension._connectionString.GetHashCode();
}
else
{
var hashCode = Extension._accountEndpoint.GetHashCode();
hashCode = Extension._accountEndpoint.GetHashCode();
hashCode = (hashCode * 397) ^ Extension._accountKey.GetHashCode();
hashCode = (hashCode * 397) ^ (Extension._region?.GetHashCode() ?? 0);
hashCode = (hashCode * 397) ^ (Extension._connectionMode?.GetHashCode() ?? 0);
_serviceProviderHash = hashCode;
}

hashCode = (hashCode * 397) ^ (Extension._region?.GetHashCode() ?? 0);
hashCode = (hashCode * 397) ^ (Extension._connectionMode?.GetHashCode() ?? 0);
_serviceProviderHash = hashCode;
}

return _serviceProviderHash.Value;
Expand Down
3 changes: 1 addition & 2 deletions test/EFCore.Cosmos.FunctionalTests/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"Test": {
"Cosmos": {
"DefaultConnection": "https://localhost:8081",
"AuthToken": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==",
"ConnectionString": "AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw=="
"AuthToken": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw=="
}
}
}

0 comments on commit 2a41afe

Please sign in to comment.