Search documentationEsc

TimeStampedItem

A base helper class that implements IItemWithTimeStamps

Namespace: Microsoft.Azure.CosmosRepository
Kind: class

A base helper class that implements IItemWithTimeStamps

public class TimeStampedItem : Item, IItemWithTimeStamps, IItem

Example

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

public class SubItem : ItemWithTimeToLive
{
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

Propertys

TimeStampedItem.CreatedTimeUtc

Time stamp of when the item was created.

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

ReturnsDateTime}

TimeStampedItem.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

TimeStampedItem.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