public MetaTablePropertyAliasEntry Match(String propertyName, Boolean createPseudoEntry = false) { MetaTablePropertyAliasEntry output = items.FirstOrDefault(x => x.isMatch(propertyName)); if (output == null) { if (createPseudoEntry) { output = new MetaTablePropertyAliasEntry(new String[] { propertyName }); items.Add(output); } } return(output); }
/// <summary> /// Adds entry from string input. Returns newly created entry or null if no entry created /// </summary> /// <param name="commaSeparatedAlias">The comma separated alias.</param> /// <returns></returns> public MetaTablePropertyAliasEntry AddEntry(String commaSeparatedAlias) { List <String> al = new List <string>(); foreach (Match m in StringInputFormat.Matches(commaSeparatedAlias)) { if (!m.Value.isNullOrEmpty()) { al.Add(m.Value); } } if (al.Any()) { MetaTablePropertyAliasEntry output = new MetaTablePropertyAliasEntry(al); items.Add(output); return(output); } else { return(null); } }