Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions ActiveOptions.sln
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ActiveOptions.Azure.Cosmos"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ActiveOptions.Sqlite", "src\ActiveOptions.Sqlite\ActiveOptions.Sqlite.csproj", "{2622A5CA-1364-4BA5-ABD3-59C9D35029D0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestKitchen", "..\TestKitchen\src\TestKitchen\TestKitchen.csproj", "{F6411CEF-2F81-423D-B3D6-C4FC7A3B5872}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestKitchen.TestAdapter", "..\TestKitchen\src\TestKitchen.TestAdapter\TestKitchen.TestAdapter.csproj", "{20A53B99-A5FC-44BF-BEEC-8A7AAC775825}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo", "test\Demo\Demo.csproj", "{97482656-5CA8-4B62-ADAB-EAC7214EFFE4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Demo", "test\Demo\Demo.csproj", "{97482656-5CA8-4B62-ADAB-EAC7214EFFE4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -65,18 +61,6 @@ Global
{2622A5CA-1364-4BA5-ABD3-59C9D35029D0}.Package|Any CPU.Build.0 = Package|Any CPU
{2622A5CA-1364-4BA5-ABD3-59C9D35029D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2622A5CA-1364-4BA5-ABD3-59C9D35029D0}.Release|Any CPU.Build.0 = Release|Any CPU
{F6411CEF-2F81-423D-B3D6-C4FC7A3B5872}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F6411CEF-2F81-423D-B3D6-C4FC7A3B5872}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F6411CEF-2F81-423D-B3D6-C4FC7A3B5872}.Package|Any CPU.ActiveCfg = Release|Any CPU
{F6411CEF-2F81-423D-B3D6-C4FC7A3B5872}.Package|Any CPU.Build.0 = Release|Any CPU
{F6411CEF-2F81-423D-B3D6-C4FC7A3B5872}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F6411CEF-2F81-423D-B3D6-C4FC7A3B5872}.Release|Any CPU.Build.0 = Release|Any CPU
{20A53B99-A5FC-44BF-BEEC-8A7AAC775825}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20A53B99-A5FC-44BF-BEEC-8A7AAC775825}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20A53B99-A5FC-44BF-BEEC-8A7AAC775825}.Package|Any CPU.ActiveCfg = Release|Any CPU
{20A53B99-A5FC-44BF-BEEC-8A7AAC775825}.Package|Any CPU.Build.0 = Release|Any CPU
{20A53B99-A5FC-44BF-BEEC-8A7AAC775825}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20A53B99-A5FC-44BF-BEEC-8A7AAC775825}.Release|Any CPU.Build.0 = Release|Any CPU
{97482656-5CA8-4B62-ADAB-EAC7214EFFE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{97482656-5CA8-4B62-ADAB-EAC7214EFFE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{97482656-5CA8-4B62-ADAB-EAC7214EFFE4}.Package|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void InsertIfNotExists(ICosmosRepository repository)
if (manifest.Contains(k))
continue;

repository.CreateAsync(new ConfigurationDocument {Key = k, Value = v})
repository.CreateAsync(new ConfigurationDocument {Id = $"{Guid.NewGuid()}", Key = k, Value = v})
.GetAwaiter().GetResult();

changedKeys.Add(k);
Expand Down
9 changes: 5 additions & 4 deletions src/ActiveOptions.Azure.Cosmos/CosmosConfigurationProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ public bool Save<TOptions>(string key, TOptions instance)

foreach (var (k, v) in toAdd)
{
_repository.UpsertAsync(new ConfigurationDocument {Id = null, Key = k, Value = v}).GetAwaiter()
.GetResult();
_repository.UpsertAsync(new ConfigurationDocument {Id = $"{Guid.NewGuid()}", Key = k, Value = v})
.GetAwaiter().GetResult();
}

foreach (var (k, id) in toUpdateIds)
Expand Down Expand Up @@ -154,8 +154,9 @@ public override void Set(string key, string value)
if (TryGet(key, out var previousValue) && value == previousValue)
return;

var document = _repository.UpsertAsync(new ConfigurationDocument {Key = key, Value = value}).GetAwaiter()
.GetResult();
// TODO: This needs to be fixed, because without the Id it will always create a new document
var document = _repository.UpsertAsync(new ConfigurationDocument {Key = key, Value = value})
.GetAwaiter().GetResult();

lock (Data)
{
Expand Down