Search Results for

    Show / Hide Table of Contents

    Class Mapper<TFrom, TTo>

    Maps an object of TFrom type to an object of TTo type.

    Inheritance
    System.Object
    Mapper<TFrom, TTo>
    Namespace: LinqToDB.Tools.Mapper
    Assembly: linq2db.Tools.dll
    Syntax
    public class Mapper<TFrom, TTo> : object
    Type Parameters
    Name Description
    TFrom

    Type to map from.

    TTo

    Type to map to.

    Examples

    This example shows how to map one object to another.

    Methods

    | Improve this Doc View Source

    GetMapper()

    Returns a mapper to map an object of TFrom type to an object of TTo type.

    Declaration
    public Func<TFrom, TTo> GetMapper()
    Returns
    Type Description
    Func<TFrom, TTo>

    Mapping expression.

    | Improve this Doc View Source

    GetMapperEx()

    Returns a mapper to map an object of TFrom type to an object of TTo type.

    Declaration
    public Func<TFrom, TTo, IDictionary<object, object>?, TTo> GetMapperEx()
    Returns
    Type Description
    Func<TFrom, TTo, System.Nullable<IDictionary<System.Object, System.Object>>, TTo>

    Mapping expression.

    | Improve this Doc View Source

    GetMapperExpression()

    Returns a mapper expression to map an object of TFrom type to an object of TTo type. Returned expression is compatible to IQueryable.

    Declaration
    public Expression<Func<TFrom, TTo>> GetMapperExpression()
    Returns
    Type Description
    Expression<Func<TFrom, TTo>>

    Mapping expression.

    | Improve this Doc View Source

    GetMapperExpressionEx()

    Returns a mapper expression to map an object of TFrom type to an object of TTo type.

    Declaration
    public Expression<Func<TFrom, TTo, IDictionary<object, object>?, TTo>> GetMapperExpressionEx()
    Returns
    Type Description
    Expression<Func<TFrom, TTo, System.Nullable<IDictionary<System.Object, System.Object>>, TTo>>

    Mapping expression.

    | Improve this Doc View Source

    Map(TFrom)

    Returns a mapper to map an object of TFrom type to an object of TTo type.

    Declaration
    public TTo Map(TFrom source)
    Parameters
    Type Name Description
    TFrom source

    Object to map.

    Returns
    Type Description
    TTo

    Destination object.

    | Improve this Doc View Source

    Map(TFrom, TTo)

    Returns a mapper to map an object of TFrom type to an object of TTo type.

    Declaration
    public TTo Map(TFrom source, TTo destination)
    Parameters
    Type Name Description
    TFrom source

    Object to map.

    TTo destination

    Destination object.

    Returns
    Type Description
    TTo

    Destination object.

    | Improve this Doc View Source

    Map(TFrom, TTo, Nullable<IDictionary<Object, Object>>)

    Returns a mapper to map an object of TFrom type to an object of TTo type.

    Declaration
    public TTo Map(TFrom source, TTo destination, IDictionary<object, object>? crossReferenceDictionary)
    Parameters
    Type Name Description
    TFrom source

    Object to map.

    TTo destination

    Destination object.

    System.Nullable<IDictionary<System.Object, System.Object>> crossReferenceDictionary

    Storage for cress references if applied.

    Returns
    Type Description
    TTo

    Destination object.

    Extension Methods

    Map.DeepCopy<T>(T)
    Sql.IsDistinctFrom<T>(T, T)
    Sql.IsNotDistinctFrom<T>(T, T)
    SqlExtensions.In<T>(T, IEnumerable<T>)
    SqlExtensions.In<T>(T, IQueryable<T>)
    SqlExtensions.In<T>(T, T[])
    SqlExtensions.In<T>(T, T, T)
    SqlExtensions.In<T>(T, T, T, T)
    SqlExtensions.NotIn<T>(T, IEnumerable<T>)
    SqlExtensions.NotIn<T>(T, IQueryable<T>)
    SqlExtensions.NotIn<T>(T, T[])
    SqlExtensions.NotIn<T>(T, T, T)
    SqlExtensions.NotIn<T>(T, T, T, T)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2011-2022 linq2db.com

    Generated by DocFX