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)); }
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; } }