Resource.Id Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the Id of the resource in the Azure Cosmos DB service.
[Newtonsoft.Json.JsonProperty(PropertyName="id")]
public virtual string Id { get; set; }
[<Newtonsoft.Json.JsonProperty(PropertyName="id")>]
member this.Id : string with get, set
Public Overridable Property Id As String
Property Value
The Id associated with the resource.
- Attributes
-
Newtonsoft.Json.JsonPropertyAttribute
Remarks
Every resource within an Azure Cosmos DB database account needs to have a unique identifier. Unlike ResourceId, which is set internally, this Id is settable by the user and is not immutable.
When working with document resources, they too have this settable Id property. If an Id is not supplied by the user the SDK will automatically generate a new GUID and assign its value to this property before persisting the document in the database. You can override this auto Id generation by setting the disableAutomaticIdGeneration parameter on the DocumentClient instance to true. This will prevent the SDK from generating new Ids.
The following characters are restricted and cannot be used in the Id property: '/', '\\', '?', '#'
Applies to
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應