DomainObjectExtensionsGetValueOrDefaultTObject, TResult Method  | 
 
            Gets a nullable value for domain object properties, which are based on a non-nullable data attributes. The expression should be in the format 's => s.Property'.
            
 
    Namespace: 
   Aloe.SystemFrameworks.Domain.Extensions
    Assembly:
   Aloe.SystemFrameworks.Domain (in Aloe.SystemFrameworks.Domain.dll) Version: 20.1.3.5
Syntaxpublic static Nullable<TResult> GetValueOrDefault<TObject, TResult>(
	this TObject obj,
	Expression<Func<TObject, TResult>> memberExpression
)
where TObject : DomainObject
where TResult : struct, new()
<ExtensionAttribute>
Public Shared Function GetValueOrDefault(Of TObject As DomainObject, TResult As {Structure, New}) ( 
	obj As TObject,
	memberExpression As Expression(Of Func(Of TObject, TResult))
) As Nullable(Of TResult)public:
[ExtensionAttribute]
generic<typename TObject, typename TResult>
where TObject : DomainObject
where TResult : value class, gcnew()
static Nullable<TResult>^ GetValueOrDefault(
	TObject obj, 
	Expression<Func<TObject, TResult>^>^ memberExpression
)
[<ExtensionAttribute>]
static member GetValueOrDefault : 
        obj : 'TObject * 
        memberExpression : Expression<Func<'TObject, 'TResult>> -> Nullable<'TResult>  when 'TObject : DomainObject when 'TResult : struct, new()
Parameters
- obj
 - Type: TObject
The object. - memberExpression
 - Type: System.Linq.ExpressionsExpressionFuncTObject, TResult
The expression in the format 's => s.Property'. 
Type Parameters
- TObject
 - The type of the object.
 - TResult
 - The type of the result.
 
Return Value
Type: 
NullableTResultThe nullable value of the property.
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 
Extension Methods (Visual Basic) or 
Extension Methods (C# Programming Guide).
See Also