SqlSmoObject.GetPropValueOptional 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| GetPropValueOptional(String) |
從以下取得屬性值:- 如果狀態正在建立或我們處於設計模式(可能有 NULL 值),則在 property bag 中取得 - 否則呼叫我們的 OnPropertyMissing 方法(若值為 NULL,則拋出例外) |
| GetPropValueOptional<T>(String, T) |
回傳所命名屬性的值。 如果物件處於「創建」狀態且屬性尚未設定,則會回傳 defaultValue。 如果物件存在,defaultValue 會被忽略,實際值會被回傳。 |
GetPropValueOptional(String)
從以下取得屬性值:- 如果狀態正在建立或我們處於設計模式(可能有 NULL 值),則在 property bag 中取得 - 否則呼叫我們的 OnPropertyMissing 方法(若值為 NULL,則拋出例外)
protected internal object GetPropValueOptional(string propName);
member this.GetPropValueOptional : string -> obj
Protected Friend Function GetPropValueOptional (propName As String) As Object
參數
- propName
- String
傳回
適用於
GetPropValueOptional<T>(String, T)
回傳所命名屬性的值。 如果物件處於「創建」狀態且屬性尚未設定,則會回傳 defaultValue。 如果物件存在,defaultValue 會被忽略,實際值會被回傳。
public T GetPropValueOptional<T>(string propName, T defaultValue);
member this.GetPropValueOptional : string * 'T -> 'T
Public Function GetPropValueOptional(Of T) (propName As String, defaultValue As T) As T
類型參數
- T
參數
- propName
- String
- defaultValue
- T
傳回
T