public void Visit(MetadataInfo.DaxMetadata daxMetadata) { throw new System.NotImplementedException(); }
public void Visit(MetadataInfo.DaxMetadata daxMetadata) { string ssasVersion = GetSsasVersion(); Product productInfo = GetProduct(ssasVersion); daxMetadata.Version = new MetadataInfo.SsasVersion { SSAS_VERSION = ssasVersion, CAPTURE_DATE = DateTime.Now, PRODUCT_TYPE = productInfo.Type, PRODUCT_NAME = productInfo.Name }; AdomdDataReader result = _conn.ExecuteReader("SELECT * FROM $SYSTEM.MDSCHEMA_FUNCTIONS"); while (result.Read()) { // Filters only DAX functions int?origin = GetInt(result, result.GetOrdinal("ORIGIN")); if (origin == null) { continue; } if (origin != 3 && origin != 4) { continue; } var SSAS_VERSION = ssasVersion; var FUNCTION_NAME = GetString(result, result.GetOrdinal("FUNCTION_NAME")); var DESCRIPTION = GetString(result, result.GetOrdinal("DESCRIPTION")); var PARAMETER_LIST = GetString(result, result.GetOrdinal("PARAMETER_LIST")); var RETURN_TYPE = GetInt(result, result.GetOrdinal("RETURN_TYPE")); var ORIGIN = origin; var INTERFACE_NAME = GetString(result, result.GetOrdinal("INTERFACE_NAME")); var LIBRARY_NAME = GetString(result, result.GetOrdinal("LIBRARY_NAME")); var DLL_NAME = GetString(result, result.GetOrdinal("DLL_NAME")); var HELP_FILE = GetString(result, result.GetOrdinal("HELP_FILE")); var HELP_CONTEXT = GetInt(result, result.GetOrdinal("HELP_CONTEXT")); var OBJECT = GetString(result, result.GetOrdinal("OBJECT")); var CAPTION = GetString(result, result.GetOrdinal("CAPTION")); var PARAMETERINFO = GetXmlString(result, result.GetOrdinal("PARAMETERINFO")); var DIRECTQUERY_PUSHABLE = (result.FieldCount >= 14 ? GetInt(result, result.GetOrdinal("DIRECTQUERY_PUSHABLE")) : null); var function = new MetadataInfo.DaxFunction { SSAS_VERSION = ssasVersion, FUNCTION_NAME = GetString(result, result.GetOrdinal("FUNCTION_NAME")), DESCRIPTION = GetString(result, result.GetOrdinal("DESCRIPTION")), PARAMETER_LIST = GetString(result, result.GetOrdinal("PARAMETER_LIST")), RETURN_TYPE = GetInt(result, result.GetOrdinal("RETURN_TYPE")), ORIGIN = origin, INTERFACE_NAME = GetString(result, result.GetOrdinal("INTERFACE_NAME")), LIBRARY_NAME = GetString(result, result.GetOrdinal("LIBRARY_NAME")), DLL_NAME = GetString(result, result.GetOrdinal("DLL_NAME")), HELP_FILE = GetString(result, result.GetOrdinal("HELP_FILE")), HELP_CONTEXT = GetInt(result, result.GetOrdinal("HELP_CONTEXT")), OBJECT = GetString(result, result.GetOrdinal("OBJECT")), CAPTION = GetString(result, result.GetOrdinal("CAPTION")), PARAMETERINFO = GetXmlString(result, result.GetOrdinal("PARAMETERINFO")), DIRECTQUERY_PUSHABLE = (result.FieldCount >= 14 ? GetInt(result, result.GetOrdinal("DIRECTQUERY_PUSHABLE")) : null) }; daxMetadata.DaxFunctions.Add(function); } }