A Sandcastle Documented Class Library

# ModelDataExtensions GetObject TSource, TTarget Method (TSource)

Creates a object of the target type and maps all properties using default mapping rule - mapping by name.

Namespace: Dundas.BI.WebApi.Models
Assembly: Dundas.BI.WebApi (in Dundas.BI.WebApi.dll) Version: 2.0.0.0 (10.0.0.1002)
Syntax
C#
VB
C++
F#
Copy

    public static TTarget GetObject<TSource, TTarget>(
    	this TSource source
    )
    where TTarget : new()

    <ExtensionAttribute>
    Public Shared Function GetObject(Of TSource, TTarget As New) (
    	source As TSource
    ) As TTarget

    public:
    [ExtensionAttribute]
    generic<typename TSource, typename TTarget>
    where TTarget : gcnew()
    static TTarget GetObject(
    	TSource source
    )

    [<ExtensionAttribute>]
    static member GetObject :
            source : 'TSource -> 'TTarget  when 'TTarget : new()

#### Parameters

source
  Type: TSource
  The source object - object which properties will be copied over the target.

#### Type Parameters

TSource
  The type of the source.
TTarget
  The type of the target.

#### Return Value

Type: TTarget
Newly created and initialized object of the target type.

#### 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

#### Reference

ModelDataExtensions Class
GetObject Overload
Dundas.BI.WebApi.Models Namespace