A Sandcastle Documented Class Library

# ModelDataExtensions CreateMapping TSource, TTarget Method (TSource)

Creates a mapping object. This is an object that can create an object of given type and copy all public properties from an existing object over the new one. This mapping object can be extended with custom mapping rules.

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 ModelMapping<TSource, TTarget> CreateMapping<TSource, TTarget>(
    	this TSource source
    )
    where TSource : class
    where TTarget : class, new()

    <ExtensionAttribute>
    Public Shared Function CreateMapping(Of TSource As Class, TTarget As {Class, New}) (
    	source As TSource
    ) As ModelMapping(Of TSource, TTarget)

    public:
    [ExtensionAttribute]
    generic<typename TSource, typename TTarget>
    where TSource : ref class
    where TTarget : ref class, gcnew()
    static ModelMapping<TSource, TTarget>^ CreateMapping(
    	TSource source
    )

    [<ExtensionAttribute>]
    static member CreateMapping :
            source : 'TSource -> ModelMapping<'TSource, 'TTarget>  when 'TSource : not struct when 'TTarget : not struct, 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: ModelMapping
TSource, 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
CreateMapping Overload
Dundas.BI.WebApi.Models Namespace