internal ChoKVPRecordFieldConfiguration(string name, ChoKVPRecordFieldAttribute attr = null) : base(name, attr) { FieldName = name; if (attr != null) { FieldName = attr.FieldName.IsNullOrWhiteSpace() ? Name.NTrim() : attr.FieldName.NTrim(); } }
internal ChoKVPRecordFieldConfiguration(string name, ChoKVPRecordFieldAttribute attr = null, Attribute[] otherAttrs = null) : base(name, attr, otherAttrs) { FieldName = name; if (attr != null) { FieldName = attr.FieldName.IsNullOrWhiteSpace() ? Name : attr.FieldName; } }
internal ChoKVPRecordFieldConfiguration GetFieldConfiguration(string propertyName, ChoKVPRecordFieldAttribute attr = null, Attribute[] otherAttrs = null) { if (!KVPRecordFieldConfigurations.Any(fc => fc.Name == propertyName)) { KVPRecordFieldConfigurations.Add(new ChoKVPRecordFieldConfiguration(propertyName, attr, otherAttrs)); } return(KVPRecordFieldConfigurations.First(fc => fc.Name == propertyName)); }