Skip to content

Instantly share code, notes, and snippets.

@kcargile
Created August 8, 2012 17:51
Show Gist options
  • Save kcargile/3297043 to your computer and use it in GitHub Desktop.
Save kcargile/3297043 to your computer and use it in GitHub Desktop.
.NET Fluent nHibernate IVersionConvention for MSSQL rowversion column.
using FluentNHibernate.Conventions;
using FluentNHibernate.Conventions.Instances;
namespace Data
{
public class RowVersionConvention : IVersionConvention
{
public void Apply(IVersionInstance instance)
{
instance.Column("RowVersion");
instance.CustomType("BinaryBlob");
instance.CustomSqlType("timestamp");
instance.Generated.Always();
instance.UnsavedValue("null");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment