Amss.Boilerplate.Persistence.Impl.AuditInterceptor.OnSave C# (CSharp) Method

OnSave() public method

public OnSave ( object entity, object id, object state, string propertyNames, IType types ) : bool
entity object
id object
state object
propertyNames string
types IType
return bool
        public override bool OnSave(
            object entity,
            object id,
            object[] state,
            string[] propertyNames,
            IType[] types)
        {
            var changed = false;
            if (entity is IAuditable)
            {
                var dateIndex = Array.FindIndex(
                    propertyNames, n => CreatedDatePropertyName.Equals(n, StringComparison.Ordinal));
                Contract.Assert(dateIndex > -1);
                state[dateIndex] = DateTime.Now;

                changed = true;
            }

            return changed;
        }
AuditInterceptor