AbstractModelCollection<(Of <(<'T, TPropertyTracking>)>)>..::..GetNew<(Of <(<'TValue>)>)> Method (Func<(Of <(<'TValue>)>)>, String)

Fetches a value, creating it if it doesn't exist.

Namespace:  Tortuga.Anchor.Modeling.Internals
Assembly:  Tortuga.Anchor (in Tortuga.Anchor.dll)

Syntax


protected TValue GetNew<TValue>(
	Func<TValue> creationFunction,
	string propertyName
)
Protected Function GetNew(Of TValue) ( _
	creationFunction As Func(Of TValue), _
	propertyName As String _
) As TValue

Type Parameters

TValue
Expected type

Parameters

creationFunction
Type: Func<(Of <(<'TValue>)>)>
Function to execute if the property doesn't already exist.
propertyName
Type: String
Case-sensitive property name

Return Value

Exceptions


ExceptionCondition
[ArgumentNullException] creationFunction;creationFunction is null. or propertyName;propertyName is null.
[ArgumentException]propertyName is empty.;propertyName

Remarks


Executing the default function will trigger validation but not a property-changed event.