/// <summary> /// call this method to map one domain object property to indicate that this property /// </summary> /// <param name="propertyName"></param> internal void RowIdWithPropertyName(string propertyName) { if (ColumnConfigurations.TryGetValue(propertyName, out ExcelPropertyBuilder value)) { if (value.Configuration.AuditPropertyType == ExcelAuditProperties.NO_AUDIT_FIELD) { throw new ArgumentException($"The property '{propertyName}' is already configured" + $" as an data attribute and cannot be tracked as an audit attribute additionally."); } } else { var propertyBuilder = new ExcelPropertyBuilder <int>(); propertyBuilder.Configuration.PropertyName = propertyName; propertyBuilder.Configuration.AuditPropertyType = Objects.Excel.ExcelAuditProperties.RowId; ColumnConfigurations.Add(propertyName, propertyBuilder); } }
/// <summary> /// call this method to map one domain object property to create an instance of <see cref="ExcelPropertyBuilder{TProperty}"/> /// to further configure this property /// </summary> /// <typeparam name="TProperty"></typeparam> /// <param name="propertyname"></param> /// <returns></returns> internal ExcelPropertyBuilder <TProperty> PropertyWithPropertyName <TProperty>(string propertyname) { if (ColumnConfigurations.TryGetValue(propertyname, out ExcelPropertyBuilder value)) { if (value.Configuration.AuditPropertyType != ExcelAuditProperties.NO_AUDIT_FIELD) { throw new ArgumentException($"The property '{propertyname}' is already configured" + $" as an audit attribute of category '{value.Configuration.AuditPropertyType}' and " + $"cannot be tracked as a normal data property mapping. "); } return((ExcelPropertyBuilder <TProperty>)value); } else { var propertyBuilder = new ExcelPropertyBuilder <TProperty>(); var propertyName = propertyname; ColumnConfigurations.Add(propertyName, propertyBuilder); return(propertyBuilder); } }
private void ValidatePropertyBuilder(ExcelPropertyBuilder propertyBuilder) { }