mirror of https://github.com/dapr/docs.git
				
				
				
			Merge pull request #3013 from hhunter-ms/issue_2937
[Dist Lock] Update .NET code
This commit is contained in:
		
						commit
						a92c3807d7
					
				|  | @ -62,12 +62,14 @@ namespace LockService | |||
| { | ||||
|     class Program | ||||
|     { | ||||
|         [Obsolete("Distributed Lock API is in Alpha, this can be removed once it is stable.")] | ||||
|         static async Task Main(string[] args) | ||||
|         { | ||||
|             string DAPR_LOCK_NAME = "lockstore"; | ||||
|             string fileName = "my_file_name"; | ||||
|             var client = new DaprClientBuilder().Build(); | ||||
| 
 | ||||
|             using (var fileLock = await client.Lock(DAPR_LOCK_NAME, "my_file_name", "random_id_abc123", 60)) | ||||
|      | ||||
|             await using (var fileLock = await client.Lock(DAPR_LOCK_NAME, fileName, "random_id_abc123", 60)) | ||||
|             { | ||||
|                 if (fileLock.Success) | ||||
|                 { | ||||
|  | @ -147,7 +149,7 @@ namespace LockService | |||
|             var client = new DaprClientBuilder().Build(); | ||||
| 
 | ||||
|             var response = await client.Unlock(DAPR_LOCK_NAME, "my_file_name", "random_id_abc123")); | ||||
|             Console.WriteLine(response.LockStatus); | ||||
|             Console.WriteLine(response.status); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -51,7 +51,7 @@ The above example uses secrets as plain strings. It is recommended to use a secr | |||
| | clientSecret | Y | Output | The commercetools client secret for the project | `"client secret"` | | ||||
| | scopes | Y | Output | The commercetools scopes for the project | `"manage_project:project-key"` | | ||||
| 
 | ||||
| For more information see [commercetools - Creating an API Client](https://docs.commercetools.com/tutorials/getting-started#creating-an-api-client) and [commercetools - Regions](https://docs.commercetools.com/api/general-concepts#regions). | ||||
| For more information see [commercetools - Creating an API Client](https://docs.commercetools.com/getting-started/create-api-client#create-an-api-client) and [commercetools - Regions](https://docs.commercetools.com/api/general-concepts#regions). | ||||
| 
 | ||||
| ## Binding support | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue