StructuralObject.SetValidValue 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
SetValidValue(Nullable<Int16>, String)
確保為屬性所設定的 Int16 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static Nullable<short> SetValidValue(Nullable<short> value, string propertyName);
static member SetValidValue : Nullable<int16> * string -> Nullable<int16>
Protected Friend Shared Function SetValidValue (value As Nullable(Of Short), propertyName As String) As Nullable(Of Short)
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
所設定的可為 null 的Int16 值。
- 屬性
適用於
SetValidValue(Nullable<Guid>, String)
確保為屬性所設定的 Guid 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static Nullable<Guid> SetValidValue(Nullable<Guid> value, string propertyName);
static member SetValidValue : Nullable<Guid> * string -> Nullable<Guid>
Protected Friend Shared Function SetValidValue (value As Nullable(Of Guid), propertyName As String) As Nullable(Of Guid)
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
所設定的可為 null 的Guid 值。
- 屬性
適用於
SetValidValue(Nullable<Double>, String)
確保為屬性所設定的 Double 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static Nullable<double> SetValidValue(Nullable<double> value, string propertyName);
static member SetValidValue : Nullable<double> * string -> Nullable<double>
Protected Friend Shared Function SetValidValue (value As Nullable(Of Double), propertyName As String) As Nullable(Of Double)
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
所設定的可為 null 的Double 值。
- 屬性
適用於
SetValidValue(Nullable<Decimal>, String)
確保為屬性所設定的 Decimal 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static Nullable<decimal> SetValidValue(Nullable<decimal> value, string propertyName);
static member SetValidValue : Nullable<decimal> * string -> Nullable<decimal>
Protected Friend Shared Function SetValidValue (value As Nullable(Of Decimal), propertyName As String) As Nullable(Of Decimal)
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
所設定的可為 null 的Decimal 值。
- 屬性
適用於
SetValidValue(Nullable<DateTimeOffset>, String)
確保為屬性所設定的 DateTimeOffset 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static Nullable<DateTimeOffset> SetValidValue(Nullable<DateTimeOffset> value, string propertyName);
static member SetValidValue : Nullable<DateTimeOffset> * string -> Nullable<DateTimeOffset>
Protected Friend Shared Function SetValidValue (value As Nullable(Of DateTimeOffset), propertyName As String) As Nullable(Of DateTimeOffset)
參數
- value
- Nullable<DateTimeOffset>
- propertyName
- String
正受驗證的屬性的名稱。
傳回
正在設定的 DateTimeOffset 值。
- 屬性
適用於
SetValidValue(Nullable<DateTime>, String)
確保為屬性所設定的 DateTime 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static Nullable<DateTime> SetValidValue(Nullable<DateTime> value, string propertyName);
static member SetValidValue : Nullable<DateTime> * string -> Nullable<DateTime>
Protected Friend Shared Function SetValidValue (value As Nullable(Of DateTime), propertyName As String) As Nullable(Of DateTime)
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
所設定的可為 null 的DateTime 值。
- 屬性
適用於
SetValidValue(Nullable<Byte>, String)
確保為屬性所設定的 Byte 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static Nullable<byte> SetValidValue(Nullable<byte> value, string propertyName);
static member SetValidValue : Nullable<byte> * string -> Nullable<byte>
Protected Friend Shared Function SetValidValue (value As Nullable(Of Byte), propertyName As String) As Nullable(Of Byte)
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
所設定的可為 null 的Byte 值。
- 屬性
適用於
SetValidValue(Double, String)
確保為屬性所設定的 Double 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static double SetValidValue(double value, string propertyName);
static member SetValidValue : double * string -> double
Protected Friend Shared Function SetValidValue (value As Double, propertyName As String) As Double
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
正在設定的 Double 值。
- 屬性
適用於
SetValidValue(Int64, String)
確保為屬性所設定的 Int64 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static long SetValidValue(long value, string propertyName);
static member SetValidValue : int64 * string -> int64
Protected Friend Shared Function SetValidValue (value As Long, propertyName As String) As Long
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
正在設定的 Int64 值。
- 屬性
適用於
SetValidValue(Int32, String)
確保為屬性所設定的 Int32 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static int SetValidValue(int value, string propertyName);
static member SetValidValue : int * string -> int
Protected Friend Shared Function SetValidValue (value As Integer, propertyName As String) As Integer
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
正在設定的 Int32 值。
- 屬性
適用於
SetValidValue(Int16, String)
確保為屬性所設定的 Int16 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static short SetValidValue(short value, string propertyName);
static member SetValidValue : int16 * string -> int16
Protected Friend Shared Function SetValidValue (value As Short, propertyName As String) As Short
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
正在設定的 Int16 值。
- 屬性
適用於
SetValidValue(Guid, String)
確保為屬性所設定的 Guid 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static Guid SetValidValue(Guid value, string propertyName);
static member SetValidValue : Guid * string -> Guid
Protected Friend Shared Function SetValidValue (value As Guid, propertyName As String) As Guid
參數
- propertyName
- String
正在驗證的屬性的名稱。
傳回
正在設定的 Guid 值。
- 屬性
適用於
SetValidValue(Nullable<Int32>, String)
確保為屬性所設定的 Int32 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static Nullable<int> SetValidValue(Nullable<int> value, string propertyName);
static member SetValidValue : Nullable<int> * string -> Nullable<int>
Protected Friend Shared Function SetValidValue (value As Nullable(Of Integer), propertyName As String) As Nullable(Of Integer)
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
所設定的可為 null 的Int32 值。
- 屬性
適用於
SetValidValue(Decimal, String)
確保為屬性所設定的 Decimal 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static decimal SetValidValue(decimal value, string propertyName);
static member SetValidValue : decimal * string -> decimal
Protected Friend Shared Function SetValidValue (value As Decimal, propertyName As String) As Decimal
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
正在設定的 Decimal 值。
- 屬性
適用於
SetValidValue(DateTimeOffset, String)
確保為屬性所設定的 DateTimeOffset 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static DateTimeOffset SetValidValue(DateTimeOffset value, string propertyName);
static member SetValidValue : DateTimeOffset * string -> DateTimeOffset
Protected Friend Shared Function SetValidValue (value As DateTimeOffset, propertyName As String) As DateTimeOffset
參數
- value
- DateTimeOffset
- propertyName
- String
正受驗證的屬性的名稱。
傳回
正在設定的 DateTimeOffset 值。
- 屬性
適用於
SetValidValue(Nullable<Boolean>, String)
確保為屬性所設定的 Boolean 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static Nullable<bool> SetValidValue(Nullable<bool> value, string propertyName);
static member SetValidValue : Nullable<bool> * string -> Nullable<bool>
Protected Friend Shared Function SetValidValue (value As Nullable(Of Boolean), propertyName As String) As Nullable(Of Boolean)
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
所設定的可為 null 的Boolean 值。
- 屬性
適用於
SetValidValue(Nullable<Int64>, String)
確保為屬性所設定的 Int64 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static Nullable<long> SetValidValue(Nullable<long> value, string propertyName);
static member SetValidValue : Nullable<int64> * string -> Nullable<int64>
Protected Friend Shared Function SetValidValue (value As Nullable(Of Long), propertyName As String) As Nullable(Of Long)
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
所設定的可為 null 的Int64 值。
- 屬性
適用於
SetValidValue(Nullable<UInt64>, String)
重要
此 API 不符合 CLS 規範。
確保為屬性所設定的 UInt64 值是有效的。
[System.CLSCompliant(false)]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static Nullable<ulong> SetValidValue(Nullable<ulong> value, string propertyName);
static member SetValidValue : Nullable<uint64> * string -> Nullable<uint64>
Protected Friend Shared Function SetValidValue (value As Nullable(Of ULong), propertyName As String) As Nullable(Of ULong)
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
所設定的可為 null 的 UInt64 值。
- 屬性
適用於
SetValidValue(Nullable<Single>, String)
確保為屬性所設定的 Single 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static Nullable<float> SetValidValue(Nullable<float> value, string propertyName);
static member SetValidValue : Nullable<single> * string -> Nullable<single>
Protected Friend Shared Function SetValidValue (value As Nullable(Of Single), propertyName As String) As Nullable(Of Single)
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
所設定的可為 null 的Single 值。
- 屬性
適用於
SetValidValue(String, Boolean, String)
驗證屬性是否不是 null,如果它是則擲回。
protected internal static string SetValidValue(string value, bool isNullable, string propertyName);
static member SetValidValue : string * bool * string -> string
Protected Friend Shared Function SetValidValue (value As String, isNullable As Boolean, propertyName As String) As String
參數
- value
- String
要檢查的字串值。
- isNullable
- Boolean
表示此屬性是否可為 null 的旗標。
- propertyName
- String
正受驗證的屬性的名稱。
傳回
驗證的屬性。
例外狀況
針對不可為 null 的字串,此字串值會是 null。
適用於
SetValidValue(DbGeometry, Boolean, String)
驗證屬性是否不是 null,如果它是則擲回。
protected internal static System.Data.Entity.Spatial.DbGeometry SetValidValue(System.Data.Entity.Spatial.DbGeometry value, bool isNullable, string propertyName);
static member SetValidValue : System.Data.Entity.Spatial.DbGeometry * bool * string -> System.Data.Entity.Spatial.DbGeometry
Protected Friend Shared Function SetValidValue (value As DbGeometry, isNullable As Boolean, propertyName As String) As DbGeometry
參數
- value
- DbGeometry
要檢查的 DbGeometry 值。
- isNullable
- Boolean
表示此屬性是否可為 null 的旗標。
- propertyName
- String
正受驗證的屬性的名稱。
傳回
正在設定的 DbGeometry 值。
例外狀況
針對不可為 Null 的屬性,值會是 null。
適用於
SetValidValue(DbGeography, Boolean, String)
驗證屬性是否不是 null,如果它是則擲回。
protected internal static System.Data.Entity.Spatial.DbGeography SetValidValue(System.Data.Entity.Spatial.DbGeography value, bool isNullable, string propertyName);
static member SetValidValue : System.Data.Entity.Spatial.DbGeography * bool * string -> System.Data.Entity.Spatial.DbGeography
Protected Friend Shared Function SetValidValue (value As DbGeography, isNullable As Boolean, propertyName As String) As DbGeography
參數
- value
- DbGeography
要檢查的 DbGeography 值。
- isNullable
- Boolean
表示此屬性是否可為 null 的旗標。
- propertyName
- String
正在驗證的屬性的名稱。
傳回
正在設定的 DbGeography 值。
例外狀況
針對不可為 Null 的屬性,值會是 null。
適用於
SetValidValue(Byte[], Boolean, String)
確保為屬性所設定的 System.Byte[] 值是有效的。
protected internal static byte[] SetValidValue(byte[] value, bool isNullable, string propertyName);
static member SetValidValue : byte[] * bool * string -> byte[]
Protected Friend Shared Function SetValidValue (value As Byte(), isNullable As Boolean, propertyName As String) As Byte()
參數
- value
- Byte[]
傳遞至屬性 Setter 的值。
- isNullable
- Boolean
表示此屬性是否可為 null 的旗標。
- propertyName
- String
正受驗證的屬性的名稱。
傳回
正在驗證的 Byte 值。
例外狀況
如果不可為 null 值的值是 null。
適用於
SetValidValue(UInt64, String)
重要
此 API 不符合 CLS 規範。
確保為屬性所設定的 UInt64 值是有效的。
[System.CLSCompliant(false)]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static ulong SetValidValue(ulong value, string propertyName);
static member SetValidValue : uint64 * string -> uint64
Protected Friend Shared Function SetValidValue (value As ULong, propertyName As String) As ULong
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
正在設定的 UInt64 值。
- 屬性
適用於
SetValidValue(UInt32, String)
重要
此 API 不符合 CLS 規範。
確保為屬性所設定的 UInt32 值是有效的。
[System.CLSCompliant(false)]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static uint SetValidValue(uint value, string propertyName);
static member SetValidValue : uint32 * string -> uint32
Protected Friend Shared Function SetValidValue (value As UInteger, propertyName As String) As UInteger
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
正在設定的 UInt32 值。
- 屬性
適用於
SetValidValue(UInt16, String)
重要
此 API 不符合 CLS 規範。
確保為屬性所設定的 UInt16 值是有效的。
[System.CLSCompliant(false)]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static ushort SetValidValue(ushort value, string propertyName);
static member SetValidValue : uint16 * string -> uint16
Protected Friend Shared Function SetValidValue (value As UShort, propertyName As String) As UShort
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
正在設定的 UInt16 值。
- 屬性
適用於
SetValidValue(TimeSpan, String)
確保為屬性所設定的 TimeSpan 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static TimeSpan SetValidValue(TimeSpan value, string propertyName);
static member SetValidValue : TimeSpan * string -> TimeSpan
Protected Friend Shared Function SetValidValue (value As TimeSpan, propertyName As String) As TimeSpan
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
正在設定的 TimeSpan 值。
- 屬性
適用於
SetValidValue(String, Boolean)
驗證屬性是否不是 null,如果它是則擲回。
protected internal static string SetValidValue(string value, bool isNullable);
static member SetValidValue : string * bool -> string
Protected Friend Shared Function SetValidValue (value As String, isNullable As Boolean) As String
參數
- value
- String
要檢查的字串值。
- isNullable
- Boolean
表示此屬性是否可為 null 的旗標。
傳回
驗證的 String 值。
適用於
SetValidValue(Single, String)
確保為屬性所設定的 Single 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static float SetValidValue(float value, string propertyName);
static member SetValidValue : single * string -> single
Protected Friend Shared Function SetValidValue (value As Single, propertyName As String) As Single
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
正在設定的 Single 值。
- 屬性
適用於
SetValidValue(SByte, String)
重要
此 API 不符合 CLS 規範。
確保為屬性所設定的 SByte 值是有效的。
[System.CLSCompliant(false)]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static sbyte SetValidValue(sbyte value, string propertyName);
static member SetValidValue : sbyte * string -> sbyte
Protected Friend Shared Function SetValidValue (value As SByte, propertyName As String) As SByte
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
正在設定的 SByte 值。
- 屬性
適用於
SetValidValue(DateTime, String)
確保為屬性所設定的 DateTime 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static DateTime SetValidValue(DateTime value, string propertyName);
static member SetValidValue : DateTime * string -> DateTime
Protected Friend Shared Function SetValidValue (value As DateTime, propertyName As String) As DateTime
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
正在設定的 DateTime 值。
- 屬性
適用於
SetValidValue(Nullable<UInt32>, String)
重要
此 API 不符合 CLS 規範。
確保為屬性所設定的 UInt32 值是有效的。
[System.CLSCompliant(false)]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static Nullable<uint> SetValidValue(Nullable<uint> value, string propertyName);
static member SetValidValue : Nullable<uint32> * string -> Nullable<uint32>
Protected Friend Shared Function SetValidValue (value As Nullable(Of UInteger), propertyName As String) As Nullable(Of UInteger)
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
所設定的可為 null 的 UInt32 值。
- 屬性
適用於
SetValidValue(Nullable<UInt16>, String)
重要
此 API 不符合 CLS 規範。
確保為屬性所設定的 UInt16 值是有效的。
[System.CLSCompliant(false)]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static Nullable<ushort> SetValidValue(Nullable<ushort> value, string propertyName);
static member SetValidValue : Nullable<uint16> * string -> Nullable<uint16>
Protected Friend Shared Function SetValidValue (value As Nullable(Of UShort), propertyName As String) As Nullable(Of UShort)
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
所設定的可為 null 的 UInt16 值。
- 屬性
適用於
SetValidValue(Nullable<TimeSpan>, String)
確保為屬性所設定的 TimeSpan 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static Nullable<TimeSpan> SetValidValue(Nullable<TimeSpan> value, string propertyName);
static member SetValidValue : Nullable<TimeSpan> * string -> Nullable<TimeSpan>
Protected Friend Shared Function SetValidValue (value As Nullable(Of TimeSpan), propertyName As String) As Nullable(Of TimeSpan)
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
所設定的可為 null 的TimeSpan 值。
- 屬性
適用於
SetValidValue(Nullable<SByte>, String)
重要
此 API 不符合 CLS 規範。
確保為屬性所設定的 SByte 值是有效的。
[System.CLSCompliant(false)]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static Nullable<sbyte> SetValidValue(Nullable<sbyte> value, string propertyName);
static member SetValidValue : Nullable<sbyte> * string -> Nullable<sbyte>
Protected Friend Shared Function SetValidValue (value As Nullable(Of SByte), propertyName As String) As Nullable(Of SByte)
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
所設定的可為 null 的SByte 值。
- 屬性
適用於
SetValidValue(DbGeometry, Boolean)
驗證屬性是否不是 null,如果它是則擲回。
protected internal static System.Data.Entity.Spatial.DbGeometry SetValidValue(System.Data.Entity.Spatial.DbGeometry value, bool isNullable);
static member SetValidValue : System.Data.Entity.Spatial.DbGeometry * bool -> System.Data.Entity.Spatial.DbGeometry
Protected Friend Shared Function SetValidValue (value As DbGeometry, isNullable As Boolean) As DbGeometry
參數
- value
- DbGeometry
要檢查的 DbGeometry 值。
- isNullable
- Boolean
表示此屬性是否可為 null 的旗標。
傳回
正在設定的 DbGeometry 值。
例外狀況
針對不可為 Null 的屬性,值會是 null。
適用於
SetValidValue(UInt32)
SetValidValue(Byte[], Boolean)
確保為屬性所設定的 System.Byte[] 值是有效的。
protected internal static byte[] SetValidValue(byte[] value, bool isNullable);
static member SetValidValue : byte[] * bool -> byte[]
Protected Friend Shared Function SetValidValue (value As Byte(), isNullable As Boolean) As Byte()
參數
- value
- Byte[]
正在設定的值。
- isNullable
- Boolean
表示屬性是否可為 null。
傳回
所要設定的 Byte 值。
適用於
SetValidValue(Nullable<Decimal>)
確保為屬性所設定的 Decimal 值是有效的。
protected internal static Nullable<decimal> SetValidValue(Nullable<decimal> value);
static member SetValidValue : Nullable<decimal> -> Nullable<decimal>
Protected Friend Shared Function SetValidValue (value As Nullable(Of Decimal)) As Nullable(Of Decimal)
參數
傳回
所設定的可為 null 的Decimal 值。
適用於
SetValidValue(Nullable<DateTimeOffset>)
確保為屬性所設定的 DateTimeOffset 值是有效的。
protected internal static Nullable<DateTimeOffset> SetValidValue(Nullable<DateTimeOffset> value);
static member SetValidValue : Nullable<DateTimeOffset> -> Nullable<DateTimeOffset>
Protected Friend Shared Function SetValidValue (value As Nullable(Of DateTimeOffset)) As Nullable(Of DateTimeOffset)
參數
- value
- Nullable<DateTimeOffset>
可為 Null 的 DateTimeOffset 值。
傳回
所設定的可為 null 的DateTimeOffset 值。
適用於
SetValidValue(Nullable<DateTime>)
確保為屬性所設定的 DateTime 值是有效的。
protected internal static Nullable<DateTime> SetValidValue(Nullable<DateTime> value);
static member SetValidValue : Nullable<DateTime> -> Nullable<DateTime>
Protected Friend Shared Function SetValidValue (value As Nullable(Of DateTime)) As Nullable(Of DateTime)
參數
傳回
所設定的可為 null 的DateTime 值。
適用於
SetValidValue(Nullable<Byte>)
SetValidValue(Nullable<Boolean>)
確保為屬性所設定的 Boolean 值是有效的。
protected internal static Nullable<bool> SetValidValue(Nullable<bool> value);
static member SetValidValue : Nullable<bool> -> Nullable<bool>
Protected Friend Shared Function SetValidValue (value As Nullable(Of Boolean)) As Nullable(Of Boolean)
參數
傳回
所設定的可為 null 的Boolean 值。
適用於
SetValidValue(DateTimeOffset)
確保為屬性所設定的 DateTimeOffset 值是有效的。
protected internal static DateTimeOffset SetValidValue(DateTimeOffset value);
static member SetValidValue : DateTimeOffset -> DateTimeOffset
Protected Friend Shared Function SetValidValue (value As DateTimeOffset) As DateTimeOffset
參數
- value
- DateTimeOffset
傳回
所要設定的 DateTimeOffset 值。
適用於
SetValidValue(DateTime)
SetValidValue(Nullable<Double>)
確保為屬性所設定的 Double 值是有效的。
protected internal static Nullable<double> SetValidValue(Nullable<double> value);
static member SetValidValue : Nullable<double> -> Nullable<double>
Protected Friend Shared Function SetValidValue (value As Nullable(Of Double)) As Nullable(Of Double)
參數
傳回
所設定的可為 null 的Double 值。
適用於
SetValidValue(DbGeography, Boolean)
驗證屬性是否不是 null,如果它是則擲回。
protected internal static System.Data.Entity.Spatial.DbGeography SetValidValue(System.Data.Entity.Spatial.DbGeography value, bool isNullable);
static member SetValidValue : System.Data.Entity.Spatial.DbGeography * bool -> System.Data.Entity.Spatial.DbGeography
Protected Friend Shared Function SetValidValue (value As DbGeography, isNullable As Boolean) As DbGeography
參數
- value
- DbGeography
要檢查的 DbGeography 值。
- isNullable
- Boolean
表示此屬性是否可為 null 的旗標。
傳回
正在設定的 DbGeography 值。
例外狀況
針對不可為 Null 的屬性,值會是 null。
適用於
SetValidValue(Nullable<Guid>)
SetValidValue(Nullable<Int32>)
SetValidValue(Byte, String)
確保為屬性所設定的 Byte 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static byte SetValidValue(byte value, string propertyName);
static member SetValidValue : byte * string -> byte
Protected Friend Shared Function SetValidValue (value As Byte, propertyName As String) As Byte
參數
- propertyName
- String
正受驗證的屬性的名稱。
傳回
已設定的 Byte。
- 屬性
適用於
SetValidValue(Boolean, String)
確保為屬性所設定的 Boolean 值是有效的。
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="propertyName")]
protected internal static bool SetValidValue(bool value, string propertyName);
static member SetValidValue : bool * string -> bool
Protected Friend Shared Function SetValidValue (value As Boolean, propertyName As String) As Boolean
參數
- value
- Boolean
布林值
- propertyName
- String
正受驗證的屬性的名稱。
傳回
正在設定的 Boolean 值。
- 屬性
適用於
SetValidValue(UInt64)
SetValidValue(UInt16)
SetValidValue(TimeSpan)
SetValidValue(Nullable<Int16>)
SetValidValue(Nullable<UInt32>)
重要
此 API 不符合 CLS 規範。
確保為屬性所設定的 UInt32 值是有效的。
[System.CLSCompliant(false)]
protected internal static Nullable<uint> SetValidValue(Nullable<uint> value);
static member SetValidValue : Nullable<uint32> -> Nullable<uint32>
Protected Friend Shared Function SetValidValue (value As Nullable(Of UInteger)) As Nullable(Of UInteger)
參數
傳回
所設定的可為 null 的 UInt32 值。
- 屬性
適用於
SetValidValue(Nullable<UInt16>)
重要
此 API 不符合 CLS 規範。
確保為屬性所設定的 UInt16 值是有效的。
[System.CLSCompliant(false)]
protected internal static Nullable<ushort> SetValidValue(Nullable<ushort> value);
static member SetValidValue : Nullable<uint16> -> Nullable<uint16>
Protected Friend Shared Function SetValidValue (value As Nullable(Of UShort)) As Nullable(Of UShort)
參數
傳回
所設定的可為 null 的 UInt16 值。
- 屬性
適用於
SetValidValue(Nullable<TimeSpan>)
確保為屬性所設定的 TimeSpan 值是有效的。
protected internal static Nullable<TimeSpan> SetValidValue(Nullable<TimeSpan> value);
static member SetValidValue : Nullable<TimeSpan> -> Nullable<TimeSpan>
Protected Friend Shared Function SetValidValue (value As Nullable(Of TimeSpan)) As Nullable(Of TimeSpan)
參數
傳回
所設定的可為 null 的TimeSpan 值。
適用於
SetValidValue(Nullable<Single>)
確保為屬性所設定的 Single 值是有效的。
protected internal static Nullable<float> SetValidValue(Nullable<float> value);
static member SetValidValue : Nullable<single> -> Nullable<single>
Protected Friend Shared Function SetValidValue (value As Nullable(Of Single)) As Nullable(Of Single)
參數
傳回
所設定的可為 null 的Single 值。
適用於
SetValidValue(Nullable<SByte>)
重要
此 API 不符合 CLS 規範。
確保為屬性所設定的 SByte 值是有效的。
[System.CLSCompliant(false)]
protected internal static Nullable<sbyte> SetValidValue(Nullable<sbyte> value);
static member SetValidValue : Nullable<sbyte> -> Nullable<sbyte>
Protected Friend Shared Function SetValidValue (value As Nullable(Of SByte)) As Nullable(Of SByte)
參數
傳回
所設定的可為 null 的SByte 值。
- 屬性
適用於
SetValidValue(Nullable<Int64>)
SetValidValue(Nullable<UInt64>)
重要
此 API 不符合 CLS 規範。
確保為屬性所設定的 UInt64 值是有效的。
[System.CLSCompliant(false)]
protected internal static Nullable<ulong> SetValidValue(Nullable<ulong> value);
static member SetValidValue : Nullable<uint64> -> Nullable<uint64>
Protected Friend Shared Function SetValidValue (value As Nullable(Of ULong)) As Nullable(Of ULong)
參數
傳回
所設定的可為 null 的 UInt64 值。
- 屬性
適用於
SetValidValue<T>(T, T, String)
設定指定之屬性的複雜物件。
protected internal T SetValidValue<T>(T oldValue, T newValue, string property) where T : System.Data.Entity.Core.Objects.DataClasses.ComplexObject;
member this.SetValidValue : 'T * 'T * string -> 'T (requires 'T :> System.Data.Entity.Core.Objects.DataClasses.ComplexObject)
Protected Friend Function SetValidValue(Of T As ComplexObject) (oldValue As T, newValue As T, property As String) As T
類型參數
- T
正要取代之物件的型別。
參數
- oldValue
- T
屬性的原始複雜物件 (如果有的話)。
- newValue
- T
正在設定的複雜物件。
- property
- String
正在設定為複雜物件的複雜屬性。
傳回
衍生自複雜物件的複雜型別。