StructuralObject.SetValidValue Method

Definition

Makes sure the value being set for a property is valid.

Overloads

SetValidValue(Nullable<Int16>, String)

Makes sure the Int16 value being set for a property is valid.

SetValidValue(Nullable<Guid>, String)

Makes sure the Guid value being set for a property is valid.

SetValidValue(Nullable<Double>, String)

Makes sure the Double value being set for a property is valid.

SetValidValue(Nullable<Decimal>, String)

Makes sure the Decimal value being set for a property is valid.

SetValidValue(Nullable<DateTimeOffset>, String)

Makes sure the DateTimeOffset value being set for a property is valid.

SetValidValue(Nullable<DateTime>, String)

Makes sure the DateTime value being set for a property is valid.

SetValidValue(Nullable<Byte>, String)

Makes sure the Byte value being set for a property is valid.

SetValidValue(Double, String)

Makes sure the Double value being set for a property is valid.

SetValidValue(Int64, String)

Makes sure the Int64 value being set for a property is valid.

SetValidValue(Int32, String)

Makes sure the Int32 value being set for a property is valid.

SetValidValue(Int16, String)

Makes sure the Int16 value being set for a property is valid.

SetValidValue(Guid, String)

Makes sure the Guid value being set for a property is valid.

SetValidValue(Nullable<Int32>, String)

Makes sure the Int32 value being set for a property is valid.

SetValidValue(Decimal, String)

Makes sure the Decimal value being set for a property is valid.

SetValidValue(DateTimeOffset, String)

Makes sure the DateTimeOffset value being set for a property is valid.

SetValidValue(Nullable<Boolean>, String)

Makes sure the Boolean value being set for a property is valid.

SetValidValue(Nullable<Int64>, String)

Makes sure the Int64 value being set for a property is valid.

SetValidValue(Nullable<UInt64>, String)

Makes sure the UInt64 value being set for a property is valid.

SetValidValue(Nullable<Single>, String)

Makes sure the Single value being set for a property is valid.

SetValidValue(String, Boolean, String)

Validates that the property is not null, and throws if it is.

SetValidValue(DbGeometry, Boolean, String)

Validates that the property is not null, and throws if it is.

SetValidValue(DbGeography, Boolean, String)

Validates that the property is not null, and throws if it is.

SetValidValue(Byte[], Boolean, String)

Makes sure the Byte array value being set for a property is valid.

SetValidValue(UInt64, String)

Makes sure the UInt64 value being set for a property is valid.

SetValidValue(UInt32, String)

Makes sure the UInt32 value being set for a property is valid.

SetValidValue(UInt16, String)

Makes sure the UInt16 value being set for a property is valid.

SetValidValue(TimeSpan, String)

Makes sure the TimeSpan value being set for a property is valid.

SetValidValue(String, Boolean)

Validates that the property is not null, and throws if it is.

SetValidValue(Single, String)

Makes sure the Single value being set for a property is valid.

SetValidValue(SByte, String)

Makes sure the SByte value being set for a property is valid.

SetValidValue(DateTime, String)

Makes sure the DateTime value being set for a property is valid.

SetValidValue(Nullable<UInt32>, String)

Makes sure the UInt32 value being set for a property is valid.

SetValidValue(Nullable<UInt16>, String)

Makes sure the UInt16 value being set for a property is valid.

SetValidValue(Nullable<TimeSpan>, String)

Makes sure the TimeSpan value being set for a property is valid.

SetValidValue(Nullable<SByte>, String)

Makes sure the SByte value being set for a property is valid.

SetValidValue(DbGeometry, Boolean)

Validates that the property is not null, and throws if it is.

SetValidValue(UInt32)

Makes sure the UInt32 value being set for a property is valid.

SetValidValue(Byte[], Boolean)

Makes sure the byte array value being set for a property is valid.

SetValidValue(Nullable<Decimal>)

Makes sure the Decimal value being set for a property is valid.

SetValidValue(Nullable<DateTimeOffset>)

Makes sure the DateTimeOffset value being set for a property is valid.

SetValidValue(Nullable<DateTime>)

Makes sure the DateTime value being set for a property is valid.

SetValidValue(Nullable<Byte>)

Makes sure the Byte value being set for a property is valid.

SetValidValue(Nullable<Boolean>)

Makes sure the Boolean value being set for a property is valid.

SetValidValue(Int64)

Makes sure the Int64 value being set for a property is valid.

SetValidValue(Int32)

Makes sure the Int32 value being set for a property is valid.

SetValidValue(Int16)

Makes sure the Int16 value being set for a property is valid.

SetValidValue(Guid)

Makes sure the Guid value being set for a property is valid.

SetValidValue(Double)

Makes sure the Double value being set for a property is valid.

SetValidValue(Decimal)

Makes sure the Decimal value being set for a property is valid.

SetValidValue(DateTimeOffset)

Makes sure the DateTimeOffset value being set for a property is valid.

SetValidValue(DateTime)

Makes sure the DateTime value being set for a property is valid.

SetValidValue(Byte)

Makes sure the Byte value being set for a property is valid.

SetValidValue(Boolean)

Makes sure the Boolean value being set for a property is valid.

SetValidValue(Nullable<Double>)

Makes sure the Double value being set for a property is valid.

SetValidValue(DbGeography, Boolean)

Validates that the property is not null, and throws if it is.

SetValidValue(Nullable<Guid>)

Makes sure the Guid value being set for a property is valid.

SetValidValue(Nullable<Int32>)

Makes sure the Int32 value being set for a property is valid.

SetValidValue(Byte, String)

Makes sure the Byte value being set for a property is valid.

SetValidValue(Boolean, String)

Makes sure the Boolean value being set for a property is valid.

SetValidValue(UInt64)

Makes sure the UInt64 value being set for a property is valid.

SetValidValue(UInt16)

Makes sure the UInt16 value being set for a property is valid.

SetValidValue(TimeSpan)

Makes sure the TimeSpan value being set for a property is valid.

SetValidValue(Single)

Makes sure the Single value being set for a property is valid.

SetValidValue(Nullable<Int16>)

Makes sure the Int16 value being set for a property is valid.

SetValidValue(SByte)

Makes sure the SByte value being set for a property is valid.

SetValidValue(Nullable<UInt32>)

Makes sure the UInt32 value being set for a property is valid.

SetValidValue(Nullable<UInt16>)

Makes sure the UInt16 value being set for a property is valid.

SetValidValue(Nullable<TimeSpan>)

Makes sure the TimeSpan value being set for a property is valid.

SetValidValue(Nullable<Single>)

Makes sure the Single value being set for a property is valid.

SetValidValue(Nullable<SByte>)

Makes sure the SByte value being set for a property is valid.

SetValidValue(Nullable<Int64>)

Makes sure the Int64 value being set for a property is valid.

SetValidValue(Nullable<UInt64>)

Makes sure the UInt64 value being set for a property is valid.

SetValidValue<T>(T, T, String)

Sets a complex object for the specified property.

SetValidValue(Nullable<Int16>, String)

Makes sure the Int16 value being set for a property is valid.

C#
protected internal static short? SetValidValue(short? value, string propertyName);

Parameters

value
Nullable<Int16>

The nullable Int16 value.

propertyName
String

The name of the property that is being validated.

Returns

The nullable Int16 value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<Guid>, String)

Makes sure the Guid value being set for a property is valid.

C#
protected internal static Guid? SetValidValue(Guid? value, string propertyName);

Parameters

value
Nullable<Guid>

The nullable Guid value.

propertyName
String

The name of the property that is being validated.

Returns

The nullable Guid value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<Double>, String)

Makes sure the Double value being set for a property is valid.

C#
protected internal static double? SetValidValue(double? value, string propertyName);

Parameters

value
Nullable<Double>

The nullable Double value.

propertyName
String

The name of the property that is being validated.

Returns

The nullable Double value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<Decimal>, String)

Makes sure the Decimal value being set for a property is valid.

C#
protected internal static decimal? SetValidValue(decimal? value, string propertyName);

Parameters

value
Nullable<Decimal>

The nullable Decimal value.

propertyName
String

The name of the property that is being validated.

Returns

The nullable Decimal value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<DateTimeOffset>, String)

Makes sure the DateTimeOffset value being set for a property is valid.

C#
protected internal static DateTimeOffset? SetValidValue(DateTimeOffset? value, string propertyName);

Parameters

propertyName
String

The name of the property that is being validated.

Returns

The DateTimeOffset value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<DateTime>, String)

Makes sure the DateTime value being set for a property is valid.

C#
protected internal static DateTime? SetValidValue(DateTime? value, string propertyName);

Parameters

value
Nullable<DateTime>

The nullable DateTime value.

propertyName
String

The name of the property that is being validated.

Returns

The nullable DateTime value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<Byte>, String)

Makes sure the Byte value being set for a property is valid.

C#
protected internal static byte? SetValidValue(byte? value, string propertyName);

Parameters

value
Nullable<Byte>

The nullable Byte value.

propertyName
String

The name of the property that is being validated.

Returns

The nullable Byte value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Double, String)

Makes sure the Double value being set for a property is valid.

C#
protected internal static double SetValidValue(double value, string propertyName);

Parameters

value
Double

The Double value.

propertyName
String

The name of the property that is being validated.

Returns

The Double value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Int64, String)

Makes sure the Int64 value being set for a property is valid.

C#
protected internal static long SetValidValue(long value, string propertyName);

Parameters

value
Int64

The Int64 value.

propertyName
String

The name of the property that is being validated.

Returns

The Int64 value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Int32, String)

Makes sure the Int32 value being set for a property is valid.

C#
protected internal static int SetValidValue(int value, string propertyName);

Parameters

value
Int32

The Int32 value.

propertyName
String

The name of the property that is being validated.

Returns

The Int32 value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Int16, String)

Makes sure the Int16 value being set for a property is valid.

C#
protected internal static short SetValidValue(short value, string propertyName);

Parameters

value
Int16

The Int16 value.

propertyName
String

The name of the property that is being validated.

Returns

The Int16 value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Guid, String)

Makes sure the Guid value being set for a property is valid.

C#
protected internal static Guid SetValidValue(Guid value, string propertyName);

Parameters

value
Guid

The Guid value.

propertyName
String

Name of the property that is being validated.

Returns

The Guid value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<Int32>, String)

Makes sure the Int32 value being set for a property is valid.

C#
protected internal static int? SetValidValue(int? value, string propertyName);

Parameters

value
Nullable<Int32>

The nullable Int32 value.

propertyName
String

The name of the property that is being validated.

Returns

The nullable Int32 value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Decimal, String)

Makes sure the Decimal value being set for a property is valid.

C#
protected internal static decimal SetValidValue(decimal value, string propertyName);

Parameters

value
Decimal

The Decimal value.

propertyName
String

The name of the property that is being validated.

Returns

The Decimal value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(DateTimeOffset, String)

Makes sure the DateTimeOffset value being set for a property is valid.

C#
protected internal static DateTimeOffset SetValidValue(DateTimeOffset value, string propertyName);

Parameters

value
DateTimeOffset

The DateTimeOffset value.

propertyName
String

The name of the property that is being validated.

Returns

The DateTimeOffset value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<Boolean>, String)

Makes sure the Boolean value being set for a property is valid.

C#
protected internal static bool? SetValidValue(bool? value, string propertyName);

Parameters

value
Nullable<Boolean>

The nullable Boolean value.

propertyName
String

The name of the property that is being validated.

Returns

The nullable Boolean value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<Int64>, String)

Makes sure the Int64 value being set for a property is valid.

C#
protected internal static long? SetValidValue(long? value, string propertyName);

Parameters

value
Nullable<Int64>

The nullable Int64 value.

propertyName
String

The name of the property that is being validated.

Returns

The nullable Int64 value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<UInt64>, String)

Important

This API is not CLS-compliant.

Makes sure the UInt64 value being set for a property is valid.

C#
[System.CLSCompliant(false)]
protected internal static ulong? SetValidValue(ulong? value, string propertyName);

Parameters

value
Nullable<UInt64>

The nullable UInt64 value.

propertyName
String

The name of the property that is being validated.

Returns

The nullable UInt64 value being set.

Attributes

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<Single>, String)

Makes sure the Single value being set for a property is valid.

C#
protected internal static float? SetValidValue(float? value, string propertyName);

Parameters

value
Nullable<Single>

The nullable Single value.

propertyName
String

The name of the property that is being validated.

Returns

The nullable Single value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(String, Boolean, String)

Validates that the property is not null, and throws if it is.

C#
protected internal static string SetValidValue(string value, bool isNullable, string propertyName);

Parameters

value
String

The string value to be checked.

isNullable
Boolean

Flag indicating if this property is allowed to be null.

propertyName
String

The name of the property that is being validated.

Returns

The validated property.

Exceptions

The string value is null for a non-nullable string.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(DbGeometry, Boolean, String)

Validates that the property is not null, and throws if it is.

C#
protected internal static System.Data.Spatial.DbGeometry SetValidValue(System.Data.Spatial.DbGeometry value, bool isNullable, string propertyName);

Parameters

value
DbGeometry

DbGeometry value to be checked.

isNullable
Boolean

Flag indicating if this property is allowed to be null.

propertyName
String

The name of the property that is being validated.

Returns

The DbGeometry value being set.

Exceptions

The value is null for a non-nullable property.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(DbGeography, Boolean, String)

Validates that the property is not null, and throws if it is.

C#
protected internal static System.Data.Spatial.DbGeography SetValidValue(System.Data.Spatial.DbGeography value, bool isNullable, string propertyName);

Parameters

value
DbGeography

The DbGeography value to be checked.

isNullable
Boolean

Flag indicating if this property is allowed to be null.

propertyName
String

Name of the property that is being validated.

Returns

The DbGeography value being set.

Exceptions

The value is null for a non-nullable property.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Byte[], Boolean, String)

Makes sure the Byte array value being set for a property is valid.

C#
protected internal static byte[] SetValidValue(byte[] value, bool isNullable, string propertyName);

Parameters

value
Byte[]

The value passed into the property setter.

isNullable
Boolean

Flag indicating if this property is allowed to be null.

propertyName
String

The name of the property that is being validated.

Returns

Byte[]

The Byte value being validated.

Exceptions

If value is null for a non nullable value.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(UInt64, String)

Important

This API is not CLS-compliant.

Makes sure the UInt64 value being set for a property is valid.

C#
[System.CLSCompliant(false)]
protected internal static ulong SetValidValue(ulong value, string propertyName);

Parameters

value
UInt64

The UInt64 value.

propertyName
String

The name of the property that is being validated.

Returns

The UInt64 value being set.

Attributes

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(UInt32, String)

Important

This API is not CLS-compliant.

Makes sure the UInt32 value being set for a property is valid.

C#
[System.CLSCompliant(false)]
protected internal static uint SetValidValue(uint value, string propertyName);

Parameters

value
UInt32

The UInt32 value.

propertyName
String

The name of the property that is being validated.

Returns

The UInt32 value being set.

Attributes

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(UInt16, String)

Important

This API is not CLS-compliant.

Makes sure the UInt16 value being set for a property is valid.

C#
[System.CLSCompliant(false)]
protected internal static ushort SetValidValue(ushort value, string propertyName);

Parameters

value
UInt16

The UInt16 value.

propertyName
String

The name of the property that is being validated.

Returns

The UInt16 value being set.

Attributes

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(TimeSpan, String)

Makes sure the TimeSpan value being set for a property is valid.

C#
protected internal static TimeSpan SetValidValue(TimeSpan value, string propertyName);

Parameters

value
TimeSpan

The TimeSpan value.

propertyName
String

The name of the property that is being validated.

Returns

The TimeSpan value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(String, Boolean)

Validates that the property is not null, and throws if it is.

C#
protected internal static string SetValidValue(string value, bool isNullable);

Parameters

value
String

The string value to be checked.

isNullable
Boolean

Flag indicating if this property is allowed to be null.

Returns

The validated String value.

Exceptions

If value is null for a non-nullable value.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Single, String)

Makes sure the Single value being set for a property is valid.

C#
protected internal static float SetValidValue(float value, string propertyName);

Parameters

value
Single

The Single value.

propertyName
String

The name of the property that is being validated.

Returns

The Single value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(SByte, String)

Important

This API is not CLS-compliant.

Makes sure the SByte value being set for a property is valid.

C#
[System.CLSCompliant(false)]
protected internal static sbyte SetValidValue(sbyte value, string propertyName);

Parameters

value
SByte

The SByte value.

propertyName
String

The name of the property that is being validated.

Returns

The SByte value being set.

Attributes

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(DateTime, String)

Makes sure the DateTime value being set for a property is valid.

C#
protected internal static DateTime SetValidValue(DateTime value, string propertyName);

Parameters

value
DateTime

The DateTime value.

propertyName
String

The name of the property that is being validated.

Returns

The DateTime value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<UInt32>, String)

Important

This API is not CLS-compliant.

Makes sure the UInt32 value being set for a property is valid.

C#
[System.CLSCompliant(false)]
protected internal static uint? SetValidValue(uint? value, string propertyName);

Parameters

value
Nullable<UInt32>

The nullable UInt32 value.

propertyName
String

The name of the property that is being validated.

Returns

The nullable UInt32 value being set.

Attributes

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<UInt16>, String)

Important

This API is not CLS-compliant.

Makes sure the UInt16 value being set for a property is valid.

C#
[System.CLSCompliant(false)]
protected internal static ushort? SetValidValue(ushort? value, string propertyName);

Parameters

value
Nullable<UInt16>

The nullable UInt16 value.

propertyName
String

The name of the property that is being validated.

Returns

The nullable UInt16 value being set.

Attributes

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<TimeSpan>, String)

Makes sure the TimeSpan value being set for a property is valid.

C#
protected internal static TimeSpan? SetValidValue(TimeSpan? value, string propertyName);

Parameters

value
Nullable<TimeSpan>

The nullable TimeSpan value.

propertyName
String

The name of the property that is being validated.

Returns

The nullable TimeSpan value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<SByte>, String)

Important

This API is not CLS-compliant.

Makes sure the SByte value being set for a property is valid.

C#
[System.CLSCompliant(false)]
protected internal static sbyte? SetValidValue(sbyte? value, string propertyName);

Parameters

value
Nullable<SByte>

The nullable SByte value.

propertyName
String

The name of the property that is being validated.

Returns

The nullable SByte value being set.

Attributes

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(DbGeometry, Boolean)

Validates that the property is not null, and throws if it is.

C#
protected internal static System.Data.Spatial.DbGeometry SetValidValue(System.Data.Spatial.DbGeometry value, bool isNullable);

Parameters

value
DbGeometry

The DbGeometry value to be checked.

isNullable
Boolean

Flag indicating if this property is allowed to be null.

Returns

The DbGeometry value being set.

Exceptions

The value is null for a non-nullable property.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(UInt32)

Important

This API is not CLS-compliant.

Makes sure the UInt32 value being set for a property is valid.

C#
[System.CLSCompliant(false)]
protected internal static uint SetValidValue(uint value);

Parameters

value
UInt32

The UInt32 value.

Returns

The UInt32 value being set.

Attributes

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Byte[], Boolean)

Makes sure the byte array value being set for a property is valid.

C#
protected internal static byte[] SetValidValue(byte[] value, bool isNullable);

Parameters

value
Byte[]

The value being set.

isNullable
Boolean

Indicates whether the property is nullable.

Returns

Byte[]

A Byte value being set.

Exceptions

If value is null for a non-nullable value.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<Decimal>)

Makes sure the Decimal value being set for a property is valid.

C#
protected internal static decimal? SetValidValue(decimal? value);

Parameters

value
Nullable<Decimal>

The nullable Decimal value.

Returns

The nullable Decimal value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<DateTimeOffset>)

Makes sure the DateTimeOffset value being set for a property is valid.

C#
protected internal static DateTimeOffset? SetValidValue(DateTimeOffset? value);

Parameters

value
Nullable<DateTimeOffset>

The nullable DateTimeOffset value.

Returns

The nullable DateTimeOffset value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<DateTime>)

Makes sure the DateTime value being set for a property is valid.

C#
protected internal static DateTime? SetValidValue(DateTime? value);

Parameters

value
Nullable<DateTime>

The nullable DateTime value.

Returns

The nullable DateTime value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<Byte>)

Makes sure the Byte value being set for a property is valid.

C#
protected internal static byte? SetValidValue(byte? value);

Parameters

value
Nullable<Byte>

The nullable Byte value.

Returns

The nullable Byte value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<Boolean>)

Makes sure the Boolean value being set for a property is valid.

C#
protected internal static bool? SetValidValue(bool? value);

Parameters

value
Nullable<Boolean>

The nullable Boolean value.

Returns

The nullable Boolean value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Int64)

Makes sure the Int64 value being set for a property is valid.

C#
protected internal static long SetValidValue(long value);

Parameters

value
Int64

The Int64 value.

Returns

The Int64 value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Int32)

Makes sure the Int32 value being set for a property is valid.

C#
protected internal static int SetValidValue(int value);

Parameters

value
Int32

The Int32 value.

Returns

The Int32 value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Int16)

Makes sure the Int16 value being set for a property is valid.

C#
protected internal static short SetValidValue(short value);

Parameters

value
Int16

The Int16 value.

Returns

The Int16 value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Guid)

Makes sure the Guid value being set for a property is valid.

C#
protected internal static Guid SetValidValue(Guid value);

Parameters

value
Guid

The Guid value.

Returns

The Guid value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Double)

Makes sure the Double value being set for a property is valid.

C#
protected internal static double SetValidValue(double value);

Parameters

value
Double

The Double value.

Returns

The Double value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Decimal)

Makes sure the Decimal value being set for a property is valid.

C#
protected internal static decimal SetValidValue(decimal value);

Parameters

value
Decimal

The Decimal value.

Returns

The Decimal value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(DateTimeOffset)

Makes sure the DateTimeOffset value being set for a property is valid.

C#
protected internal static DateTimeOffset SetValidValue(DateTimeOffset value);

Parameters

value
DateTimeOffset

The DateTimeOffset value.

Returns

A DateTimeOffset value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(DateTime)

Makes sure the DateTime value being set for a property is valid.

C#
protected internal static DateTime SetValidValue(DateTime value);

Parameters

value
DateTime

The DateTime value.

Returns

The DateTime value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Byte)

Makes sure the Byte value being set for a property is valid.

C#
protected internal static byte SetValidValue(byte value);

Parameters

value
Byte

The value that is being validated.

Returns

The Byte value that is set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Boolean)

Makes sure the Boolean value being set for a property is valid.

C#
protected internal static bool SetValidValue(bool value);

Parameters

value
Boolean

The Boolean value.

Returns

The Boolean value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<Double>)

Makes sure the Double value being set for a property is valid.

C#
protected internal static double? SetValidValue(double? value);

Parameters

value
Nullable<Double>

The nullable Double value.

Returns

The nullable Double value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(DbGeography, Boolean)

Validates that the property is not null, and throws if it is.

C#
protected internal static System.Data.Spatial.DbGeography SetValidValue(System.Data.Spatial.DbGeography value, bool isNullable);

Parameters

value
DbGeography

DbGeography value to be checked.

isNullable
Boolean

Flag indicating if this property is allowed to be null.

Returns

The DbGeography value being set.

Exceptions

The value is null for a non-nullable property.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<Guid>)

Makes sure the Guid value being set for a property is valid.

C#
protected internal static Guid? SetValidValue(Guid? value);

Parameters

value
Nullable<Guid>

The nullable Guid value.

Returns

The nullable Guid value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<Int32>)

Makes sure the Int32 value being set for a property is valid.

C#
protected internal static int? SetValidValue(int? value);

Parameters

value
Nullable<Int32>

The nullable Int32 value.

Returns

The nullable Int32 value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Byte, String)

Makes sure the Byte value being set for a property is valid.

C#
protected internal static byte SetValidValue(byte value, string propertyName);

Parameters

value
Byte

The Byte value.

propertyName
String

The name of the property that is being validated.

Returns

A Byte that is set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Boolean, String)

Makes sure the Boolean value being set for a property is valid.

C#
protected internal static bool SetValidValue(bool value, string propertyName);

Parameters

value
Boolean

The Boolean value.

propertyName
String

The name of the property that is being validated.

Returns

The Boolean value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(UInt64)

Important

This API is not CLS-compliant.

Makes sure the UInt64 value being set for a property is valid.

C#
[System.CLSCompliant(false)]
protected internal static ulong SetValidValue(ulong value);

Parameters

value
UInt64

The UInt64 value.

Returns

The UInt64 value being set.

Attributes

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(UInt16)

Important

This API is not CLS-compliant.

Makes sure the UInt16 value being set for a property is valid.

C#
[System.CLSCompliant(false)]
protected internal static ushort SetValidValue(ushort value);

Parameters

value
UInt16

The UInt16 value.

Returns

The UInt16 value being set.

Attributes

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(TimeSpan)

Makes sure the TimeSpan value being set for a property is valid.

C#
protected internal static TimeSpan SetValidValue(TimeSpan value);

Parameters

value
TimeSpan

The TimeSpan value.

Returns

The TimeSpan value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Single)

Makes sure the Single value being set for a property is valid.

C#
protected internal static float SetValidValue(float value);

Parameters

value
Single

The Single value.

Returns

The Single value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<Int16>)

Makes sure the Int16 value being set for a property is valid.

C#
protected internal static short? SetValidValue(short? value);

Parameters

value
Nullable<Int16>

The nullable Int16 value.

Returns

The nullable Int16 value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(SByte)

Important

This API is not CLS-compliant.

Makes sure the SByte value being set for a property is valid.

C#
[System.CLSCompliant(false)]
protected internal static sbyte SetValidValue(sbyte value);

Parameters

value
SByte

The SByte value.

Returns

The SByte value being set.

Attributes

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<UInt32>)

Important

This API is not CLS-compliant.

Makes sure the UInt32 value being set for a property is valid.

C#
[System.CLSCompliant(false)]
protected internal static uint? SetValidValue(uint? value);

Parameters

value
Nullable<UInt32>

The nullable UInt32 value.

Returns

The nullable UInt32 value being set.

Attributes

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<UInt16>)

Important

This API is not CLS-compliant.

Makes sure the UInt16 value being set for a property is valid.

C#
[System.CLSCompliant(false)]
protected internal static ushort? SetValidValue(ushort? value);

Parameters

value
Nullable<UInt16>

The nullable UInt16 value.

Returns

The nullable UInt16 value being set.

Attributes

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<TimeSpan>)

Makes sure the TimeSpan value being set for a property is valid.

C#
protected internal static TimeSpan? SetValidValue(TimeSpan? value);

Parameters

value
Nullable<TimeSpan>

The nullable TimeSpan value.

Returns

The nullable TimeSpan value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<Single>)

Makes sure the Single value being set for a property is valid.

C#
protected internal static float? SetValidValue(float? value);

Parameters

value
Nullable<Single>

The nullable Single value.

Returns

The nullable Single value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<SByte>)

Important

This API is not CLS-compliant.

Makes sure the SByte value being set for a property is valid.

C#
[System.CLSCompliant(false)]
protected internal static sbyte? SetValidValue(sbyte? value);

Parameters

value
Nullable<SByte>

The nullable SByte value.

Returns

The nullable SByte value being set.

Attributes

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<Int64>)

Makes sure the Int64 value being set for a property is valid.

C#
protected internal static long? SetValidValue(long? value);

Parameters

value
Nullable<Int64>

The nullable Int64 value.

Returns

The nullable Int64 value being set.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue(Nullable<UInt64>)

Important

This API is not CLS-compliant.

Makes sure the UInt64 value being set for a property is valid.

C#
[System.CLSCompliant(false)]
protected internal static ulong? SetValidValue(ulong? value);

Parameters

value
Nullable<UInt64>

The nullable UInt64 value.

Returns

The nullable UInt64 value being set.

Attributes

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetValidValue<T>(T, T, String)

Sets a complex object for the specified property.

C#
protected internal T SetValidValue<T>(T oldValue, T newValue, string property) where T : System.Data.Objects.DataClasses.ComplexObject;

Type Parameters

T

The type of the object being replaced.

Parameters

oldValue
T

The original complex object for the property, if any.

newValue
T

The complex object is being set.

property
String

The complex property that is being set to the complex object.

Returns

T

A complex type that derives from complex object.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1