mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-17 01:25:40 -05:00
Fixed the issue with nodeType set to null for many sql objects in object explorer (#323)
* Fixed the issue with nodeType set to null for sql objects
This commit is contained in:
@@ -58,10 +58,22 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||
NodeValue = smoObject.Name;
|
||||
ScriptSchemaObjectBase schemaBasecObject = smoObject as ScriptSchemaObjectBase;
|
||||
ObjectMetadata = new Metadata.Contracts.ObjectMetadata();
|
||||
ObjectMetadata.Name = smoObject.Name;
|
||||
|
||||
try
|
||||
{
|
||||
if(smoObject.Urn != null)
|
||||
{
|
||||
ObjectMetadata.MetadataTypeName = smoObject.Urn.Type;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
//Ignore the exception, sometimes the urn returns exception and I' not sure why
|
||||
}
|
||||
|
||||
if (schemaBasecObject != null)
|
||||
{
|
||||
ObjectMetadata.MetadataTypeName = schemaBasecObject.Urn?.Type;
|
||||
ObjectMetadata.Name = schemaBasecObject.Name;
|
||||
ObjectMetadata.Schema = schemaBasecObject.Schema;
|
||||
if (!string.IsNullOrEmpty(ObjectMetadata.Schema))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user