This documentation is archived and is not being maintained.

StructuralObject.GetValidValue<T> Method (T, String, Boolean, Boolean)

Returns a complex type for the specified property.

Namespace:  System.Data.Objects.DataClasses
Assembly:  System.Data.Entity (in System.Data.Entity.dll)

protected internal T GetValidValue<T>(
	T currentValue,
	string property,
	bool isNullable,
	bool isInitialized
where T : new(), ComplexObject

Type Parameters


The type of the complex object being requested. This type must inherit from ComplexObject.


Type: T
A complex object that inherits from ComplexObject.
Type: System.String
The name of the complex property that is the complex object.
Type: System.Boolean
Indicates whether the type supports null values.
Type: System.Boolean
Indicated whether the type is initialized.

Return Value

Type: T
A complex type object for the property.

This method is used to return a new complex type when the complex type for a property is null.

If the type is not initialized and does not support null values, this method calls the SetValidValue method to assign a complex type to the property. If the value is initialized, the existing value is returned.

.NET Framework

Supported in: 4, 3.5 SP1

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.