Search documentationEsc

FullItem

A base helper class that implements IItemWithEtag

Namespace: Microsoft.Azure.CosmosRepository
Kind: class

A base helper class that implements IItemWithEtag

This base class will implement all supported interfaces giving the complete information available from this SDK.

public abstract class FullItem : Item, IItemWithEtag, IItemWithTimeToLive, IItemWithTimeStamps, IItem

Example

Here is an example subclass item, which adds several properties:

public class SubItem : FullItem
{
public DateTimeOffset Date { get; set; }
public string Name { get; set; }
public IEnumerable<Child> Children { get; set; }
public IEnumerable<string> Tags { get; set; }
}
public class Child
{
public string Name { get; set; }
public DateTime BirthDate { get; set; }
}

Members

Constructors

FullItem.FullItem()

Default constructor

protected FullItem()

FullItem.FullItem(string)

A constructor that allows the etag to be set so that items can be mapped to and from other objects

protected FullItem(string etag)

Parameters

NameTypeDescription
etagString

Propertys

FullItem.Etag

Etag for the item which was set by Cosmos the last time the item was updated. This string is used for the relevant operations when specified.

[JsonProperty("_etag")]
public string? Etag { get; }

ReturnsString

FullItem.TimeToLive

The time an item should exist within the container.

When setting this to a positive integer this requires the default TTL at container level to be set to a non-null value.

[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public TimeSpan? TimeToLive { get; set; }

ReturnsTimeSpan}

FullItem.LastUpdatedTimeUtc

Time stamp of the last update.

This value will not be updated on the object passed into create / update methods.

[JsonIgnore]
public DateTime LastUpdatedTimeUtc { get; }

ReturnsDateTime

FullItem.LastUpdatedTimeRaw

Epoch time the last update or when the item was created in Cosmos.

Stored as stored in Cosmos DB.

This value will not be updated on the object passed into create / update methods.

[JsonProperty("_ts")]
public long LastUpdatedTimeRaw { get; }

ReturnsInt64

FullItem.CreatedTimeUtc

Time stamp of when the item was created.

[JsonProperty]
public DateTime? CreatedTimeUtc { get; set; }

ReturnsDateTime}