MiscUtils NonNull T  Method NFX Class Library

[This is preliminary documentation and is subject to change.]

Checks the value for null and throws exception if it is. The method is useful for .ctor call chaining to preclude otherwise anonymous NullReferenceException

Namespace: NFX
Assembly: NFX (in NFX.dll) Version: 3.0.0.1 (3.0.0.1)
Syntax

public static T NonNull<T>(
	this T obj,
	Func<Exception> error = null,
	string text = null
)
where T : class

Parameters

obj
Type: T
error (Optional)
Type: OnlineSystem Func OnlineException 
text (Optional)
Type: OnlineSystem String
Type Parameters

T

Return Value

Type: T

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see OnlineExtension Methods (Visual Basic) or OnlineExtension Methods (C# Programming Guide).
See Also