views:

136

answers:

0

Hi, I am trying to create a fluent Nhibernate automap convention for all the modifiedDate property of my application where it should set the value to get the current date during UPDATE. I am trying the following and its not working. 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");

    }
}