I am building EF Code first POCOs that'll be used between an Oracle back-end and a MS SQL Server backend. I'm having a problem finding the right way to tackle a Timestamp property that'll work on either database back-end.
MS SQL Server would have me use a common property like this:
[Timestamp]
public byte[] Timestamp {get;set;}
And then in the fluent mapping it would look like this
map.Property(p => p.Timestamp).IsRowVersion();
However Oracle would have me change my common property type to this:
public int Timestamp {get;set;}
And then in the fluent mapping it would look like this
map.Property(p => p.Timestamp).HasColumnName("ORA_ROWSCN").HasDatabaseGeneratedOption(DatabaseGeneratedOption.Computed).IsConcurrencyToken();
So my first guess was maybe I could change the data type to long, since timestamp is eight bytes, but SqlServer didn't like the mapping.
My next guess is to give up on Timestamp and Ora_RowScn and make up my own Optimistic Concurrency property. Any suggestions or know if a way to have a happy model that works between both Sql and Oracle? Thanks.