Guys, is there a way to retrieve only stored procedures from the storage model (SSDL) in MetadataWorkspace?
I am currently using the following code to retrieve stored procedures from MetadataWorkspace (I am checking the built-in attribute of the EdmFunction object):
public static List<EdmFunction> TryGetSsdlFunctions( this MetadataWorkspace metadataWorkspace )
{
List<EdmFunction> functions = new List<EdmFunction>();
foreach ( EdmFunction function in metadataWorkspace.GetItems<EdmFunction>( DataSpace.SSpace ) )
{
MetadataProperty builtInAttribute = function.MetadataProperties.FirstOrDefault( p => p.Name == "BuiltInAttribute" );
if ( builtInAttribute != null && Convert.ToBoolean( builtInAttribute.Value.ToString() ) == false )
{
functions.Add( function );
}
}
return functions;
}
The problem is that in addition to stored procedures, this will return all the functions included in the data model. And I want only stored procedures. I see that there are differences in the value of the IsComposable attribute, but I'm not sure if this is a reliable criterion.
Thanks in advance.
ps: If you think there is a more reasonable way to extract stored procedures from the workspace, share it.