语言

Server.IsSupportedProperty 方法

定义

重载

名称 说明
IsSupportedProperty(Type, String, DatabaseEngineEdition)

如果给定的属性名称对服务器的版本和版本的 Type 类型的对象有效,则返回 true。

IsSupportedProperty<T>(Expression<Func<T,Object>>, DatabaseEngineEdition)

如果表达式标识当前服务器版本和版本的有效 SqlSmoObject 属性,则返回 true

IsSupportedProperty<T>(String, DatabaseEngineEdition)

如果给定的属性名称对服务器的版本和版本的类型 T 的对象有效,则返回 true。

IsSupportedProperty(Type, String, DatabaseEngineEdition)

如果给定的属性名称对服务器的版本和版本的 Type 类型的对象有效,则返回 true。

public bool IsSupportedProperty(Type type, string propertyName, Microsoft.SqlServer.Management.Common.DatabaseEngineEdition databaseEngineEdition = Microsoft.SqlServer.Management.Common.DatabaseEngineEdition.Unknown);
override this.IsSupportedProperty : Type * string * Microsoft.SqlServer.Management.Common.DatabaseEngineEdition -> bool
Public Function IsSupportedProperty (type As Type, propertyName As String, Optional databaseEngineEdition As DatabaseEngineEdition = Microsoft.SqlServer.Management.Common.DatabaseEngineEdition.Unknown) As Boolean

参数

type
Type

可分配给 SqlSmoObject 的类型

propertyName
String
databaseEngineEdition
DatabaseEngineEdition

用于检查支持的属性的特定数据库版本。 如果未知或未指定,则检查将使用 master 数据库的版本。

返回

如果可以请求属性,则为 true;否则为 false

例外

当类型不是 SqlSmoObject 或 SqlSmoObject 没有基于服务器版本的属性可见性时

适用于

IsSupportedProperty<T>(Expression<Func<T,Object>>, DatabaseEngineEdition)

如果表达式标识当前服务器版本和版本的有效 SqlSmoObject 属性,则返回 true

public bool IsSupportedProperty<T>(System.Linq.Expressions.Expression<Func<T,object>> expression, Microsoft.SqlServer.Management.Common.DatabaseEngineEdition databaseEngineEdition = Microsoft.SqlServer.Management.Common.DatabaseEngineEdition.Unknown);
override this.IsSupportedProperty : System.Linq.Expressions.Expression<Func<'T, obj>> * Microsoft.SqlServer.Management.Common.DatabaseEngineEdition -> bool
Public Function IsSupportedProperty(Of T) (expression As Expression(Of Func(Of T, Object)), Optional databaseEngineEdition As DatabaseEngineEdition = Microsoft.SqlServer.Management.Common.DatabaseEngineEdition.Unknown) As Boolean

类型参数

T

要检查的 SqlSmoObject 的派生类型

参数

expression
Expression<Func<T,Object>>

引用 T 类型的对象的属性的 LINQ 表达式。表达式中引用的属性的名称用于查找。

databaseEngineEdition
DatabaseEngineEdition

返回

如果可以请求属性,则为 true;否则为 false

例外

当 SqlSmoObject 没有基于服务器版本的属性可见性时

示例

服务器。IsSupportedProperty<Table>(t => t.LedgerType)

适用于

IsSupportedProperty<T>(String, DatabaseEngineEdition)

如果给定的属性名称对服务器的版本和版本的类型 T 的对象有效,则返回 true。

public bool IsSupportedProperty<T>(string propertyName, Microsoft.SqlServer.Management.Common.DatabaseEngineEdition databaseEngineEdition = Microsoft.SqlServer.Management.Common.DatabaseEngineEdition.Unknown) where T : Microsoft.SqlServer.Management.Smo.SqlSmoObject;
override this.IsSupportedProperty : string * Microsoft.SqlServer.Management.Common.DatabaseEngineEdition -> bool (requires 'T :> Microsoft.SqlServer.Management.Smo.SqlSmoObject)
Public Function IsSupportedProperty(Of T As SqlSmoObject) (propertyName As String, Optional databaseEngineEdition As DatabaseEngineEdition = Microsoft.SqlServer.Management.Common.DatabaseEngineEdition.Unknown) As Boolean

类型参数

T

要检查的 SqlSmoObject 的派生类型

参数

propertyName
String
databaseEngineEdition
DatabaseEngineEdition

用于检查支持的属性的特定数据库版本。 如果未知或未指定,则检查将使用 master 数据库的版本。

返回

如果可以请求属性,则为 true;否则为 false

例外

当 SqlSmoObject 没有基于服务器版本的属性可见性时

适用于