Ultimate.Utilities.Docs
Ultimate.Utilities.ObjectUtils Class Reference

Utility methods for Objects More...

Static Public Member Functions

static TOutput IfNotNull< TInput, TOutput > (this TInput input, Func< TInput, TOutput > expression)
 Returns the sub element of an object if the object is not null. More...
 
static T DeepClone< T > (T input)
 Deep Clones an object and returns a new object More...
 
static void MapObjects (object source, object destination)
 Maps source object properties to destination object that have identical name and type.Mapping is not case sensitive. More...
 
static IList< TOut > MapObjectsList< TIn, TOut > (IEnumerable< TIn > source)
 Maps all values from the source list to a destination object type and returns a destination object list More...
 

Detailed Description

Utility methods for Objects

Member Function Documentation

static T Ultimate.Utilities.ObjectUtils.DeepClone< T > ( input)
static

Deep Clones an object and returns a new object

Template Parameters
TType of input object
Parameters
inputinput object
Returns
A new object cloned from the input
static TOutput Ultimate.Utilities.ObjectUtils.IfNotNull< TInput, TOutput > ( this TInput  input,
Func< TInput, TOutput >  expression 
)
static

Returns the sub element of an object if the object is not null.

Template Parameters
TInputinput object type
TOutputouput object type
Parameters
inputinput object
expressionLambda expression to return the output
Returns
If the input is null then returns the default value of output type else returns the output object
static void Ultimate.Utilities.ObjectUtils.MapObjects ( object  source,
object  destination 
)
static

Maps source object properties to destination object that have identical name and type.Mapping is not case sensitive.

Uses dictionary to cache the properties info which makes the mapping faster.

Parameters
sourcesource object to map from
destinationdestination object to map to
static IList<TOut> Ultimate.Utilities.ObjectUtils.MapObjectsList< TIn, TOut > ( IEnumerable< TIn >  source)
static

Maps all values from the source list to a destination object type and returns a destination object list

Template Parameters
TInsource object type
TOutdestination object type
Parameters
sourcesource list
Returns
destination object list
Type Constraints
TIn :class 
TOut :class 

The documentation for this class was generated from the following file: