ModifiedDate Version Convention

Posted by Robie on Stack Overflow See other posts from Stack Overflow or by Robie
Published on 2010-04-12T12:41:10Z Indexed on 2010/04/12 12:43 UTC
Read the original article Hit count: 349

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. I am trying the following and its not working. Please advice.

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

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

    }
}

© Stack Overflow or respective owner

Related posts about fluent-nhibernate

Related posts about automapping