Class CosmosEntityConfiguration<TEntity>
The typed Cosmos mapping for TEntity.
public sealed class CosmosEntityConfiguration<TEntity> : CosmosEntityConfiguration where TEntity : class
Type Parameters
TEntityThe entity type.
- Inheritance
-
CosmosEntityConfiguration<TEntity>
- Inherited Members
Methods
GetETag(object)
Reads the concurrency token (the document's _etag) from an entity instance, or null when
the entity declares none / carries none. When present, a Modify/Merge stages a
conditional replace (If-Match) instead of an unconditional upsert.
public override string? GetETag(object entity)
Parameters
entityobjectThe entity.
Returns
GetId(object)
Reads the Cosmos document id (always a string) from an entity instance.
public override string GetId(object entity)
Parameters
entityobjectThe entity.
Returns
GetPartitionKey(object)
Reads the partition key value from an entity instance (for point writes, patches and deletes).
public override PartitionKey GetPartitionKey(object entity)
Parameters
entityobjectThe entity.