Pip-Services-Commons-Dotnet
Properties | List of all members
PipServices3.Commons.Data.IVersioned Interface Reference

Interface for data objects that can be versioned. More...

Properties

string Version [get, set]
 

Detailed Description

Interface for data objects that can be versioned.

Versioning is often used as optimistic concurrency mechanism.

The version doesn't have to be a number, but it is recommended to use sequential values to determine if one object has newer or older version than another one.

It is a common pattern to use the time of change as the object version.

public class MyData: IStringIdentifiable, IVersioned
{
string id {get; set;}
string field1;
int field2;
string version {get; set;}
...
}
public void updateData(string correlationId, MyData item)
{
...
if (item.Version < oldItem.Version)
{
throw new ConcurrencyException(null, "VERSION_CONFLICT", "The change has older version stored value");
}
...
}

Property Documentation

◆ Version

string PipServices3.Commons.Data.IVersioned.Version
getset

The object's version.


The documentation for this interface was generated from the following file: