private static Type GetDotNetTypeForNode(JsonTreeNode node) { switch (node.Type) { case JTokenType.Boolean: return(typeof(bool)); case JTokenType.Date: return(typeof(DateTime)); case JTokenType.Float: return(typeof(double)); case JTokenType.Integer: return(typeof(int)); default: return(typeof(string)); } }
private static string GenerateAdxColumnName(JsonTreeNode node) { // replace all periods with underscores var columnName = node.Path.Replace(".", "_"); // replace array indexes with underscores var match = Regex.Match(columnName, @"\[[\d]+\]"); if (match.Success) { columnName = columnName.Replace("[", "_").Replace("]", string.Empty); } // replace beginning "@" with underscore if (columnName[0] == '@') { columnName = $"_{columnName.Substring(1)}"; } return(columnName); }