示例#1
0
        protected void SetTableInfo(System.Type entityType, string property, Action <AuditJoinTableAttribute> tableInfo)
        {
            var member = getMemberOrThrow(entityType, property);
            var attr   = new AuditJoinTableAttribute();

            tableInfo(attr);
            AttributeCollection.Add(new MemberInfoAndAttribute(entityType, member, attr));
        }
示例#2
0
        public IFluentAudit <T> SetTableInfo(Expression <Func <T, object> > property, Action <AuditJoinTableAttribute> tableInfo)
        {
            var methodInfo = property.MethodInfo();
            var attr       = new AuditJoinTableAttribute();

            tableInfo(attr);
            AttributeCollection.Add(new MemberInfoAndAttribute(typeof(T), methodInfo, attr));
            return(this);
        }
        private void AddPropertyJoinTables(PropertyInfo property, PropertyAuditingData propertyData)
        {
            // first set the join table based on the AuditJoinTable annotation
            AuditJoinTableAttribute joinTable = (AuditJoinTableAttribute)Attribute.GetCustomAttribute(property, typeof(AuditJoinTableAttribute));;

            if (joinTable != null)
            {
                propertyData.JoinTable = joinTable;
            }
            else
            {
                propertyData.JoinTable = DEFAULT_AUDIT_JOIN_TABLE;
            }
        }