Server.IsSupportedProperty 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| IsSupportedProperty(Type, String, DatabaseEngineEdition) |
若該屬性名稱對伺服器版本與版本的類型物件有效,則回傳為真。 |
| IsSupportedProperty<T>(Expression<Func<T,Object>>, DatabaseEngineEdition) |
若表達式識別出當前伺服器版本與版本的有效 SqlSmoObject 屬性,則回傳 true |
| IsSupportedProperty<T>(String, DatabaseEngineEdition) |
若該屬性名稱對伺服器版本與版本的 T 型物件有效,則回傳為真。 |
IsSupportedProperty(Type, String, DatabaseEngineEdition)
若該屬性名稱對伺服器版本與版本的類型物件有效,則回傳為真。
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
專門的資料庫版本用來檢查是否支援的物業。 若未指定或未知,則會使用主資料庫的版本。
傳回
若可請求該屬性,則為 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 型物件有效,則回傳為真。
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
專門的資料庫版本用來檢查是否支援的物業。 若未指定或未知,則會使用主資料庫的版本。
傳回
若可請求該屬性,則為 true;否則為 false
例外狀況
當 SqlSmoObject 沒有基於伺服器版本的屬性可見性時