.net - How to get primary key columns out of a TSqlObject instance? -
i'm trying primary key columns out of tsqlobject
instance in following manner:
var constraint = table.getreferenced(modelschema.primarykeyconstraint, dacqueryscopes.all);
of course doesn't work, getreferenced
method expects instance of modelrelationshipclass
instance.
so how can done?
code pk constraint given table bit this:
private static tsqlobject getprimarykeyconstraint(tsqlobject table) { ienumerable<tsqlobject> constraints = table.getreferencing(primarykeyconstraint.host, dacqueryscopes.userdefined); return constraints.first(); }
Comments
Post a Comment