views:

59

answers:

1

Hi,

I'm auditing certain values using a NHibernate Audit Inteceptor - I have inherited from the EmptyInteceptor and overridden the OnFlushDirty

public override bool OnFlushDirty(object entity, object id, object[] currentState, object[] previousState, string[] propertyNames, IType[] types)
    {

For the most part the currentState and previousState objects are what I'd expect - but I've mapped a collection and dosnt work - the previous and current both show the same collection values.

Can anyone assist please?

Heres the mapping I'm using ...

    public SalesChannelMap()
    {
        Id(x => x.ID).GeneratedBy.Custom<StringTableHiLoGenerator>(a => a.AddParam(NHibernateConstants.MaxLo, Nexus3General.HiLoGeneratorMaxLoSize.ToString()));
        Version(x => x.Version);
        Map(x => x.Name).Unique();
        Map(x => x.Exclusive);
        Map(x => x.Active);
        Map(x => x.Visible);
        Map(x => x.VehicleType);
        Map(x => x.PriceAdjustment);
        Map(x => x.Deleted);
        Map(x => x.FactoryFlag);
        Map(x => x.Initials);
        HasMany(x => x.VehicleIDs).AsBag().Element("VehicleID", m => m.Type<string>()).Table("SalesChannelVehicleLinker"); 
    }
A: 

Turns out there's other events to override concerned specifically with collections.

Andy Clarke