Created
August 8, 2012 17:51
-
-
Save kcargile/3297043 to your computer and use it in GitHub Desktop.
.NET Fluent nHibernate IVersionConvention for MSSQL rowversion column.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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