Using Numberic Value instead of TimeStamp
Posted: Wed 22 Sep 2010 18:43
I am updating my entity by attaching it to the Context. I am trying to use IsVersion attribute on a Numeric column to be used for the concurrency control. But the column value doesn’t get incremented by itself and neither does it allow updating or inserting the value for that column.
Do we have to use TimeStamp for concurrency control. Can we just create a Numeric column and set it IsVersion = true. Will this auto increment the value on Update?
[Column(Name = @"_MyVERSIONRow", Storage = "_MyVersionRow", CanBeNull = false, DbType = "NUMBER(5) NOT NULL")]
public int myVersionRow
{
get
{
return this._MyRowVersion;
}
set
{
if (this._MyRowVersion != value)
{
this._MyRowVersion = value;
}
}
}
Do we have to use TimeStamp for concurrency control. Can we just create a Numeric column and set it IsVersion = true. Will this auto increment the value on Update?
[Column(Name = @"_MyVERSIONRow", Storage = "_MyVersionRow", CanBeNull = false, DbType = "NUMBER(5) NOT NULL")]
public int myVersionRow
{
get
{
return this._MyRowVersion;
}
set
{
if (this._MyRowVersion != value)
{
this._MyRowVersion = value;
}
}
}