TSqlObject TSqlObject TSqlObject Class

Definition

Represents an instance of an object for a SQL Server database schema.

public sealed class TSqlObject
type TSqlObject = class
Public NotInheritable Class TSqlObject
Inheritance
TSqlObjectTSqlObjectTSqlObject

Properties

Item[ModelPropertyClass] Item[ModelPropertyClass] Item[ModelPropertyClass]

Returns the property value.

Name Name Name

Identity of the object.

ObjectType ObjectType ObjectType

Type of the object.

Methods

Equals(Object) Equals(Object) Equals(Object)

Checks if this TSqlObject is equal to another TSqlObject

GetAst() GetAst() GetAst()

Generates a new TSqlScript representing the AST for the TSqlObject, if this is supported for the TSqlObject. AST generation is only supported for top-level objects, with certain objects such as the DatabaseOptions and inline constraints not supporting AST generation even though they are top level types. If it's unknown whether the object is capable of being scripted then the TryGetAst(TSqlScript) method should be used instead.

The generated AST is a newly generated object that defines the information about this TSqlObject and any objects that would be scripted together with it. For example a Table would also script out the Columns and inline constraint definitions of a Table. This method can be used to copy object information from one model to another, or to script out information about objects in the model.

GetChildren() GetChildren() GetChildren()

Returns all TSqlObject child objects within the Default scope.

GetChildren(DacQueryScopes) GetChildren(DacQueryScopes) GetChildren(DacQueryScopes)

Returns all TSqlObject child objects within the specified DacQueryScopes scope.

GetHashCode() GetHashCode() GetHashCode()

Gets the Hashcode for this object

GetMetadata(ModelMetadataClass) GetMetadata(ModelMetadataClass) GetMetadata(ModelMetadataClass)

Returns the metadata property value.

GetMetadata<T>(ModelMetadataClass) GetMetadata<T>(ModelMetadataClass) GetMetadata<T>(ModelMetadataClass)

Returns the metadata property value.

GetParent(DacQueryScopes) GetParent(DacQueryScopes) GetParent(DacQueryScopes)

Returns the parent TSqlObject, if it is within the specified DacQueryScopes scope and if there is only one TSqlObject that could be the parent for this object.

GetParent() GetParent() GetParent()

Returns the parent TSqlObject, if it is within the Default scope and if there is only one TSqlObject that could be the parent for this object..

GetProperty(ModelPropertyClass) GetProperty(ModelPropertyClass) GetProperty(ModelPropertyClass)

Returns the property value.

GetProperty<T>(ModelPropertyClass) GetProperty<T>(ModelPropertyClass) GetProperty<T>(ModelPropertyClass)

Returns the property value.

GetReferenced() GetReferenced() GetReferenced()

Gets all referenced objects within the Default scope

GetReferenced(DacQueryScopes) GetReferenced(DacQueryScopes) GetReferenced(DacQueryScopes)

Gets all referenced objects within a given DacQueryScopes scope.

GetReferenced(ModelRelationshipClass) GetReferenced(ModelRelationshipClass) GetReferenced(ModelRelationshipClass)

Gets referenced objects for a given ModelRelationshipClass, where objects are within the Default scope

GetReferenced(ModelRelationshipClass, DacQueryScopes) GetReferenced(ModelRelationshipClass, DacQueryScopes) GetReferenced(ModelRelationshipClass, DacQueryScopes)

Gets referenced objects for a given ModelRelationshipClass, where objects are within a given DacQueryScopes scope.

GetReferencedRelationshipInstances(ModelRelationshipClass, DacExternalQueryScopes) GetReferencedRelationshipInstances(ModelRelationshipClass, DacExternalQueryScopes) GetReferencedRelationshipInstances(ModelRelationshipClass, DacExternalQueryScopes)

For objects referenced by this TSqlObject with a specific ModelRelationshipClass, returns the ModelRelationshipInstance defining the relationship data. This will include the referenced object if it exists, the ObjectIdentifier used to identify the referenced object, and any properties specific to this relationship. Only objects within the specified DacExternalQueryScopes scope will be returned. To return non-composite or system references the scope must be set to include externals. In addition, in this case only the ObjectIdentifier of the referenced object will be returned

GetReferencedRelationshipInstances(ModelRelationshipClass, DacQueryScopes) GetReferencedRelationshipInstances(ModelRelationshipClass, DacQueryScopes) GetReferencedRelationshipInstances(ModelRelationshipClass, DacQueryScopes)

For objects referenced by this TSqlObject with a specific ModelRelationshipClass, returns the ModelRelationshipInstance defining the relationship data. This will include the referenced object if it exists, the ObjectIdentifier used to identify the referenced object, and any properties specific to this relationship. Only objects within the specified DacQueryScopes scope will be returned. To return non-composite or system references the GetReferencedRelationshipInstances(DacExternalQueryScopes) method should be called instead

GetReferencedRelationshipInstances(ModelRelationshipClass) GetReferencedRelationshipInstances(ModelRelationshipClass) GetReferencedRelationshipInstances(ModelRelationshipClass)

For objects referenced by this TSqlObject with a specific ModelRelationshipClass, returns the ModelRelationshipInstance defining the relationship data. This will include the referenced object if it exists, the ObjectIdentifier used to identify the referenced object, and any properties specific to this relationship. Only objects within the Default scope will be returned.

GetReferencedRelationshipInstances(DacQueryScopes) GetReferencedRelationshipInstances(DacQueryScopes) GetReferencedRelationshipInstances(DacQueryScopes)

For each object referenced by this TSqlObject, returns the ModelRelationshipInstance defining the relationship data. This will include the referenced object if it exists, the ObjectIdentifier used to identify the referenced object, and any properties specific to this relationship. Only objects within the specified DacQueryScopes scope will be returned. To return non-composite or system references the GetReferencedRelationshipInstances(DacExternalQueryScopes) method should be called instead

GetReferencedRelationshipInstances(DacExternalQueryScopes) GetReferencedRelationshipInstances(DacExternalQueryScopes) GetReferencedRelationshipInstances(DacExternalQueryScopes)

For each object referenced by this TSqlObject, returns the ModelRelationshipInstance defining the relationship data. This will include the referenced object if it exists, the ObjectIdentifier used to identify the referenced object, and any properties specific to this relationship. Only objects within the specified DacQueryScopes scope will be returned. To return non-composite or system references the scope must be set to include externals. In addition, in this case only the ObjectIdentifier of the referenced object will be returned

GetReferencedRelationshipInstances() GetReferencedRelationshipInstances() GetReferencedRelationshipInstances()

For each object referenced by this TSqlObject, returns the ModelRelationshipInstance defining the relationship data. This will include the referenced object if it exists, the ObjectIdentifier used to identify the referenced object, and any properties specific to this relationship. Only objects within the Default scope will be returned.

GetReferencing() GetReferencing() GetReferencing()

Gets all referencing objects within the Default scope

GetReferencing(DacQueryScopes) GetReferencing(DacQueryScopes) GetReferencing(DacQueryScopes)

Gets all referencing objects within a given DacQueryScopes scope.

GetReferencing(ModelRelationshipClass) GetReferencing(ModelRelationshipClass) GetReferencing(ModelRelationshipClass)

Gets referencing objects, where the relationship is defined by a specific ModelRelationshipClass and where objects are within the Default scope

GetReferencing(ModelRelationshipClass, DacQueryScopes) GetReferencing(ModelRelationshipClass, DacQueryScopes) GetReferencing(ModelRelationshipClass, DacQueryScopes)

Gets referencing objects, where the relationship is defined by a specific ModelRelationshipClass and where objects are within a given DacQueryScopes scope.

GetReferencingRelationshipInstances(ModelRelationshipClass, DacQueryScopes) GetReferencingRelationshipInstances(ModelRelationshipClass, DacQueryScopes) GetReferencingRelationshipInstances(ModelRelationshipClass, DacQueryScopes)

For each object referencing this TSqlObject with a specific ModelRelationshipClass, returns the ModelRelationshipInstance defining the relationship data. This will include the referencing object - definedby the FromObject field, and any properties specific to this relationship. Only objects within the specified DacQueryScopes scope will be returned.

GetReferencingRelationshipInstances(ModelRelationshipClass) GetReferencingRelationshipInstances(ModelRelationshipClass) GetReferencingRelationshipInstances(ModelRelationshipClass)

For each object referencing this TSqlObject with a specific ModelRelationshipClass, returns the ModelRelationshipInstance defining the relationship data. This will include the referencing object - definedby the FromObject field, and any properties specific to this relationship. Only objects within the Default scope will be returned.

GetReferencingRelationshipInstances() GetReferencingRelationshipInstances() GetReferencingRelationshipInstances()

For each object referencing this TSqlObject, returns the ModelRelationshipInstance defining the relationship data. This will include the referencing object - definedby the FromObject field, and any properties specific to this relationship. Only objects within the specified DacQueryScopes scope will be returned.

GetReferencingRelationshipInstances(DacQueryScopes) GetReferencingRelationshipInstances(DacQueryScopes) GetReferencingRelationshipInstances(DacQueryScopes)

For each object referencing this TSqlObject, returns the ModelRelationshipInstance defining the relationship data. This will include the referencing object - definedby the FromObject field, and any properties specific to this relationship. Only objects within the Default scope will be returned.

GetScript() GetScript() GetScript()

Generates a CREATE script from the objects AST. AST generation is only supported for top-level objects, with certain objects such as the DatabaseOptions and inline constraints not supporting AST generation even though they are top level types. If it's unknown whether the object is capable of being scripted then the TryGetAst(TSqlScript) method should be used instead.

GetSourceInformation() GetSourceInformation() GetSourceInformation()

Gets the SourceInformation for this object, if this is available

TryGetAst(TSqlScript) TryGetAst(TSqlScript) TryGetAst(TSqlScript)

Attempts to generate an AST for the object. AST generation is only supported for top-level objects, with certain objects such as the DatabaseOptions and inline constraints not supporting AST generation even though they are top level types.

The generated AST is a newly generated object that defines the information about this TSqlObject and any objects that would be scripted together with it. For example a Table would also script out the Columns and inline constraint definitions of a Table. This method can be used to copy object information from one model to another, or to script out information about objects in the model.

TryGetScript(String) TryGetScript(String) TryGetScript(String)

Attempts to generate a CREATE script from the objects AST. AST generation is only supported for top-level objects, with certain objects such as the DatabaseOptions and inline constraints not supporting AST generation even though they are top level types. If it's unknown whether the object is capable of being scripted then the TryGetAst(TSqlScript) method should be used instead.

Applies to