Class CosmosIdentityBase
Provides the implementation of the basic properties of a Cosmos DB entity.
Inherited Members
Namespace: Benday.CosmosDb.DomainModels
Assembly: Benday.CosmosDb.dll
Syntax
public abstract class CosmosIdentityBase : IOwnedItem, ICosmosIdentity
Properties
| Edit this page View SourceDiscriminatorValue
Second-level partition key for the entity. This value describes the domain model type for the entity.
Declaration
[JsonPropertyName("discriminator")]
public virtual string DiscriminatorValue { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Etag
Optimistic concurrency token for the entity.
Declaration
[JsonPropertyName("_etag")]
public string Etag { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Id
Id of the entity.
Declaration
[JsonPropertyName("id")]
public string Id { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
OwnerId
The owner id of the entity. By default, this value will be the same as the PartitionKey for the entity.
Declaration
public virtual string OwnerId { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
PartitionKey
Top-level partition key of the entity.
Declaration
[JsonPropertyName("pk")]
public abstract string PartitionKey { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Timestamp
Timestamp of the entity in human-readable format.
Declaration
public DateTime Timestamp { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime |
TimestampUnixStyle
Timestamp of the entity.
Declaration
[JsonPropertyName("_ts")]
public long TimestampUnixStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| long |
Methods
| Edit this page View SourceGetDiscriminatorName()
Get the discriminator value for the entity.
Declaration
protected abstract string GetDiscriminatorName()
Returns
| Type | Description |
|---|---|
| string | Discriminator value |
Examples
Recommendation: this should be the class name for the domain model class