I'm trying to use GetObject
method to obtain an instance of a TSqlObject
representing a table from a referenced project:
var id = new ObjectIdentifier(new[] {"ExternalDb"}, new[] {"Schema", "TableName"});
var table = Model.GetObject(ModelSchema.Table, id, DacQueryScopes.All);
Unfortunately that doesn't seem to work.
I've read inside the doc that DacQueryScopes.All
will get all objects, EXCEPT those in a non-system db.
So I guess this is why this fails, but then how am I supposed to reach up to elements inside that other project?
If you want to query the object in the referenced project then open the dacpac for that referenced project and query that.
The ExternalDb is a pointer to but not an id of the item you want.