From 812dc72df68fde0c55017607ca7c41004c9ecfc3 Mon Sep 17 00:00:00 2001 From: Sidney Andrews Date: Mon, 8 Jan 2024 16:56:48 -0500 Subject: [PATCH 1/2] Update CosmosDbService.cs Changed formatting of `client` variable to make quickstart easier to follow. Signed-off-by: Sidney Andrews --- src/web/Services/CosmosDbService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/web/Services/CosmosDbService.cs b/src/web/Services/CosmosDbService.cs index 9492ed1..e0eaf2c 100644 --- a/src/web/Services/CosmosDbService.cs +++ b/src/web/Services/CosmosDbService.cs @@ -10,11 +10,11 @@ internal interface ICosmosDbService internal sealed class CosmosDbService : ICosmosDbService { - private readonly CosmosClient _client; + private readonly CosmosClient client; public CosmosDbService(CosmosClient client) { - this._client = client; + this.client = client; } public string GetEndpoint() => $"{this._client.Endpoint}"; @@ -22,7 +22,7 @@ public CosmosDbService(CosmosClient client) public async Task RunDemoAsync(Func writeOutputAync) { // - Database database = this._client.GetDatabase("cosmicworks"); + Database database = client.GetDatabase("cosmicworks"); // database = await database.ReadAsync(); await writeOutputAync($"Get database:\t{database.Id}"); @@ -120,4 +120,4 @@ public async Task RunDemoAsync(Func writeOutputAync) await writeOutputAync($"Request charge:\t{requestCharge:0.00}"); } } -} \ No newline at end of file +} From 21ba881acfd0bcbe65cc641f2f7bd13c63d3c6fc Mon Sep 17 00:00:00 2001 From: Sidney Andrews Date: Mon, 8 Jan 2024 16:59:02 -0500 Subject: [PATCH 2/2] Fix bug in code --- src/web/Services/CosmosDbService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/web/Services/CosmosDbService.cs b/src/web/Services/CosmosDbService.cs index e0eaf2c..9fd1bce 100644 --- a/src/web/Services/CosmosDbService.cs +++ b/src/web/Services/CosmosDbService.cs @@ -17,7 +17,7 @@ public CosmosDbService(CosmosClient client) this.client = client; } - public string GetEndpoint() => $"{this._client.Endpoint}"; + public string GetEndpoint() => $"{client.Endpoint}"; public async Task RunDemoAsync(Func writeOutputAync) {