DomainObjectExtensionsCheckNotNullTObject, TResult Method |
Checks whether the specified attribute is not null. Throws exception if the attribute is null.
Namespace:
Aloe.SystemFrameworks.Domain.Extensions
Assembly:
Aloe.SystemFrameworks.Domain (in Aloe.SystemFrameworks.Domain.dll) Version: 20.1.3.5
Syntaxpublic static TResult CheckNotNull<TObject, TResult>(
this TObject obj,
Expression<Func<TObject, TResult>> memberExpression
)
where TObject : DomainObject
<ExtensionAttribute>
Public Shared Function CheckNotNull(Of TObject As DomainObject, TResult) (
obj As TObject,
memberExpression As Expression(Of Func(Of TObject, TResult))
) As TResult
public:
[ExtensionAttribute]
generic<typename TObject, typename TResult>
where TObject : DomainObject
static TResult CheckNotNull(
TObject obj,
Expression<Func<TObject, TResult>^>^ memberExpression
)
[<ExtensionAttribute>]
static member CheckNotNull :
obj : 'TObject *
memberExpression : Expression<Func<'TObject, 'TResult>> -> 'TResult when 'TObject : DomainObject
Parameters
- obj
- Type: TObject
The object. - memberExpression
- Type: System.Linq.ExpressionsExpressionFuncTObject, TResult
The member expression.
Type Parameters
- TObject
- The type of the object.
- TResult
- The type of the attribute.
Return Value
Type:
TResultUsage 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
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Exceptions
See Also