Free version NHibernate ModifiedDate Version

I am trying to create a loose Nhibernate auto-writing convention for all modifiedDate properties of my application where it should set a value to get the current date during UPDATE. I am trying to do the following and not work. I want the SQL server to update the date. Please advice.

public class ModifiedDateVersionConvention : IVersionConvention,IVersionConventionAcceptance
{
    public void Apply(IVersionInstance instance)
    {
        instance.Default("getdate()");           
    }

    public void Accept(IAcceptanceCriteria<IVersionInspector> criteria)
    {
        criteria.Expect(x => x.Name == "ModifiedDate");

    }
}

      

+2


source to share





All Articles