Example #1
0
 public void Apply(IVersionInstance instance)
 {
     instance.Column("Version");
     instance.CustomType("BinaryBlob");
     instance.CustomSqlType("timestamp");
     instance.Generated.Always();
     instance.UnsavedValue("null");
 }
        public virtual void Apply(IVersionInstance instance)
        {
            var versionPropName = "Version";

            var property = instance.EntityType.GetProperties()
                           .FirstOrDefault(x => x.Name == versionPropName);

            if (property == null)
            {
                return;
            }

            var columnAttr = property.GetCustomAttribute <ColumnAttribute>();

            if (columnAttr != null)
            {
                versionPropName = columnAttr.Name;
            }

            instance.Column(versionPropName);
            instance.CustomType(property.PropertyType);
            instance.UnsavedValue("0");
            instance.Not.Nullable();
        }
Example #3
0
 public void Apply(IVersionInstance instance)
 {
     instance.CustomType <RowVersionType>();
     instance.CustomSqlType("rowversion");
     instance.Generated.Always();
 }