Search Results for

    Show / Hide Table of Contents

    Class MapperBuilder<TFrom, TTo>

    Builds a mapper that maps an object of TFrom type to an object of TTo type.

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

    Type to map from.

    TTo

    Type to map to.

    Properties

    | Improve this Doc View Source

    DeepCopy

    If true, performs deep copy. if default (null), the GetMapperExpression() method does not do deep copy, however the GetMapperExpressionEx() method does.

    Declaration
    public bool? DeepCopy { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Boolean>
    | Improve this Doc View Source

    FromMappingDictionary

    Defines member name mapping for source types.

    Declaration
    public Dictionary<Type, Dictionary<string, string>>? FromMappingDictionary { get; set; }
    Property Value
    Type Description
    System.Nullable<Dictionary<Type, Dictionary<System.String, System.String>>>
    | Improve this Doc View Source

    FromType

    Type to map from.

    Declaration
    public Type FromType { get; }
    Property Value
    Type Description
    Type
    | Improve this Doc View Source

    MappingSchema

    Mapping schema.

    Declaration
    public MappingSchema MappingSchema { get; set; }
    Property Value
    Type Description
    MappingSchema
    | Improve this Doc View Source

    MemberMappers

    Member mappers.

    Declaration
    public List<MemberMapperInfo>? MemberMappers { get; set; }
    Property Value
    Type Description
    System.Nullable<List<MemberMapperInfo>>
    | Improve this Doc View Source

    ProcessCrossReferences

    If true, processes object cross references. if default (null), the GetMapperExpression() method does not process cross references, however the GetMapperExpressionEx() method does.

    Declaration
    public bool? ProcessCrossReferences { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Boolean>
    | Improve this Doc View Source

    ToMappingDictionary

    Defines member name mapping for destination types.

    Declaration
    public Dictionary<Type, Dictionary<string, string>>? ToMappingDictionary { get; set; }
    Property Value
    Type Description
    System.Nullable<Dictionary<Type, Dictionary<System.String, System.String>>>
    | Improve this Doc View Source

    ToMemberFilter

    Filters target members to map.

    Declaration
    public Func<MemberAccessor, bool> ToMemberFilter { get; set; }
    Property Value
    Type Description
    Func<MemberAccessor, System.Boolean>
    | Improve this Doc View Source

    ToType

    Type to map to.

    Declaration
    public Type ToType { get; }
    Property Value
    Type Description
    Type

    Methods

    | Improve this Doc View Source

    FromMapping(IReadOnlyDictionary<String, String>)

    Defines member name mapping for source types.

    Declaration
    public MapperBuilder<TFrom, TTo> FromMapping(IReadOnlyDictionary<string, string> mapping)
    Parameters
    Type Name Description
    IReadOnlyDictionary<System.String, System.String> mapping

    Mapping parameters.

    Returns
    Type Description
    MapperBuilder<TFrom, TTo>

    Returns this mapper.

    | Improve this Doc View Source

    FromMapping(String, String)

    Defines member name mapping for source types.

    Declaration
    public MapperBuilder<TFrom, TTo> FromMapping(string memberName, string mapName)
    Parameters
    Type Name Description
    System.String memberName

    Type member name.

    System.String mapName

    Mapping name.

    Returns
    Type Description
    MapperBuilder<TFrom, TTo>

    Returns this mapper.

    | Improve this Doc View Source

    FromMapping(Type, IReadOnlyDictionary<String, String>)

    Defines member name mapping for source types.

    Declaration
    public MapperBuilder<TFrom, TTo> FromMapping(Type type, IReadOnlyDictionary<string, string> mapping)
    Parameters
    Type Name Description
    Type type

    Type to map.

    IReadOnlyDictionary<System.String, System.String> mapping

    Mapping parameters.

    Returns
    Type Description
    MapperBuilder<TFrom, TTo>

    Returns this mapper.

    | Improve this Doc View Source

    FromMapping(Type, String, String)

    Defines member name mapping for source types.

    Declaration
    public MapperBuilder<TFrom, TTo> FromMapping(Type type, string memberName, string mapName)
    Parameters
    Type Name Description
    Type type

    Type to map.

    System.String memberName

    Type member name.

    System.String mapName

    Mapping name.

    Returns
    Type Description
    MapperBuilder<TFrom, TTo>

    Returns this mapper.

    | Improve this Doc View Source

    FromMapping<T>(IReadOnlyDictionary<String, String>)

    Defines member name mapping for source types.

    Declaration
    public MapperBuilder<TFrom, TTo> FromMapping<T>(IReadOnlyDictionary<string, string> mapping)
    Parameters
    Type Name Description
    IReadOnlyDictionary<System.String, System.String> mapping

    Mapping parameters.

    Returns
    Type Description
    MapperBuilder<TFrom, TTo>

    Returns this mapper.

    Type Parameters
    Name Description
    T

    Type to map.

    | Improve this Doc View Source

    FromMapping<T>(String, String)

    Defines member name mapping for source types.

    Declaration
    public MapperBuilder<TFrom, TTo> FromMapping<T>(string memberName, string mapName)
    Parameters
    Type Name Description
    System.String memberName

    Type member name.

    System.String mapName

    Mapping name.

    Returns
    Type Description
    MapperBuilder<TFrom, TTo>

    Returns this mapper.

    Type Parameters
    Name Description
    T

    Type to map.

    | Improve this Doc View Source

    GetMapper()

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

    Declaration
    public Mapper<TFrom, TTo> GetMapper()
    Returns
    Type Description
    Mapper<TFrom, 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

    MapMember<T>(Expression<Func<TTo, T>>, Expression<Func<TFrom, T>>)

    Adds member mapper.

    Declaration
    public MapperBuilder<TFrom, TTo> MapMember<T>(Expression<Func<TTo, T>> toMember, Expression<Func<TFrom, T>> setter)
    Parameters
    Type Name Description
    Expression<Func<TTo, T>> toMember

    Expression that returns a member to map.

    Expression<Func<TFrom, T>> setter

    Expression to set the member.

    Returns
    Type Description
    MapperBuilder<TFrom, TTo>

    Returns this mapper.

    Type Parameters
    Name Description
    T

    Type of the member to map.

    Examples

    This example shows how to explicitly convert one value to another.

    | Improve this Doc View Source

    Mapping(IReadOnlyDictionary<String, String>)

    Defines member name mapping for source and destination types.

    Declaration
    public MapperBuilder<TFrom, TTo> Mapping(IReadOnlyDictionary<string, string> mapping)
    Parameters
    Type Name Description
    IReadOnlyDictionary<System.String, System.String> mapping

    Mapping parameters.

    Returns
    Type Description
    MapperBuilder<TFrom, TTo>

    Returns this mapper.

    | Improve this Doc View Source

    Mapping(String, String)

    Defines member name mapping for source and destination types.

    Declaration
    public MapperBuilder<TFrom, TTo> Mapping(string memberName, string mapName)
    Parameters
    Type Name Description
    System.String memberName

    Type member name.

    System.String mapName

    Mapping name.

    Returns
    Type Description
    MapperBuilder<TFrom, TTo>

    Returns this mapper.

    | Improve this Doc View Source

    Mapping(Type, IReadOnlyDictionary<String, String>)

    Defines member name mapping for source and destination types.

    Declaration
    public MapperBuilder<TFrom, TTo> Mapping(Type type, IReadOnlyDictionary<string, string> mapping)
    Parameters
    Type Name Description
    Type type

    Type to map.

    IReadOnlyDictionary<System.String, System.String> mapping

    Mapping parameters.

    Returns
    Type Description
    MapperBuilder<TFrom, TTo>

    Returns this mapper.

    | Improve this Doc View Source

    Mapping(Type, String, String)

    Defines member name mapping for source and destination types.

    Declaration
    public MapperBuilder<TFrom, TTo> Mapping(Type type, string memberName, string mapName)
    Parameters
    Type Name Description
    Type type

    Type to map.

    System.String memberName

    Type member name.

    System.String mapName

    Mapping name.

    Returns
    Type Description
    MapperBuilder<TFrom, TTo>

    Returns this mapper.

    | Improve this Doc View Source

    Mapping<T>(IReadOnlyDictionary<String, String>)

    Defines member name mapping for source and destination types.

    Declaration
    public MapperBuilder<TFrom, TTo> Mapping<T>(IReadOnlyDictionary<string, string> mapping)
    Parameters
    Type Name Description
    IReadOnlyDictionary<System.String, System.String> mapping

    Mapping parameters.

    Returns
    Type Description
    MapperBuilder<TFrom, TTo>

    Returns this mapper.

    Type Parameters
    Name Description
    T

    Type to map.

    | Improve this Doc View Source

    Mapping<T>(String, String)

    Defines member name mapping for source and destination types.

    Declaration
    public MapperBuilder<TFrom, TTo> Mapping<T>(string memberName, string mapName)
    Parameters
    Type Name Description
    System.String memberName

    Type member name.

    System.String mapName

    Mapping name.

    Returns
    Type Description
    MapperBuilder<TFrom, TTo>

    Returns this mapper.

    Type Parameters
    Name Description
    T

    Type to map.

    | Improve this Doc View Source

    SetDeepCopy(Nullable<Boolean>)

    If true, performs deep copy.

    Declaration
    public MapperBuilder<TFrom, TTo> SetDeepCopy(bool? deepCopy)
    Parameters
    Type Name Description
    System.Nullable<System.Boolean> deepCopy

    If true, performs deep copy.

    Returns
    Type Description
    MapperBuilder<TFrom, TTo>

    Returns this mapper.

    | Improve this Doc View Source

    SetMappingSchema(MappingSchema)

    Sets mapping schema.

    Declaration
    public MapperBuilder<TFrom, TTo> SetMappingSchema(MappingSchema schema)
    Parameters
    Type Name Description
    MappingSchema schema

    Mapping schema to set.

    Returns
    Type Description
    MapperBuilder<TFrom, TTo>

    Returns this mapper.

    | Improve this Doc View Source

    SetProcessCrossReferences(Nullable<Boolean>)

    If true, processes object cross references.

    Declaration
    public MapperBuilder<TFrom, TTo> SetProcessCrossReferences(bool? doProcess)
    Parameters
    Type Name Description
    System.Nullable<System.Boolean> doProcess

    If true, processes object cross references.

    Returns
    Type Description
    MapperBuilder<TFrom, TTo>

    Returns this mapper.

    | Improve this Doc View Source

    SetToMemberFilter(Func<MemberAccessor, Boolean>)

    Adds a predicate to filter target members to map.

    Declaration
    public MapperBuilder<TFrom, TTo> SetToMemberFilter(Func<MemberAccessor, bool> predicate)
    Parameters
    Type Name Description
    Func<MemberAccessor, System.Boolean> predicate

    Predicate to filter members to map.

    Returns
    Type Description
    MapperBuilder<TFrom, TTo>

    Returns this mapper.

    | Improve this Doc View Source

    ToMapping(IReadOnlyDictionary<String, String>)

    Defines member name mapping for destination types.

    Declaration
    public MapperBuilder<TFrom, TTo> ToMapping(IReadOnlyDictionary<string, string> mapping)
    Parameters
    Type Name Description
    IReadOnlyDictionary<System.String, System.String> mapping

    Mapping parameters.

    Returns
    Type Description
    MapperBuilder<TFrom, TTo>

    Returns this mapper.

    | Improve this Doc View Source

    ToMapping(String, String)

    Defines member name mapping for destination types.

    Declaration
    public MapperBuilder<TFrom, TTo> ToMapping(string memberName, string mapName)
    Parameters
    Type Name Description
    System.String memberName

    Type member name.

    System.String mapName

    Mapping name.

    Returns
    Type Description
    MapperBuilder<TFrom, TTo>

    Returns this mapper.

    | Improve this Doc View Source

    ToMapping(Type, IReadOnlyDictionary<String, String>)

    Defines member name mapping for destination types.

    Declaration
    public MapperBuilder<TFrom, TTo> ToMapping(Type type, IReadOnlyDictionary<string, string> mapping)
    Parameters
    Type Name Description
    Type type

    Type to map.

    IReadOnlyDictionary<System.String, System.String> mapping

    Mapping parameters.

    Returns
    Type Description
    MapperBuilder<TFrom, TTo>

    Returns this mapper.

    | Improve this Doc View Source

    ToMapping(Type, String, String)

    Defines member name mapping for destination types.

    Declaration
    public MapperBuilder<TFrom, TTo> ToMapping(Type type, string memberName, string mapName)
    Parameters
    Type Name Description
    Type type

    Type to map.

    System.String memberName

    Type member name.

    System.String mapName

    Mapping name.

    Returns
    Type Description
    MapperBuilder<TFrom, TTo>

    Returns this mapper.

    | Improve this Doc View Source

    ToMapping<T>(IReadOnlyDictionary<String, String>)

    Defines member name mapping for destination types.

    Declaration
    public MapperBuilder<TFrom, TTo> ToMapping<T>(IReadOnlyDictionary<string, string> mapping)
    Parameters
    Type Name Description
    IReadOnlyDictionary<System.String, System.String> mapping

    Mapping parameters.

    Returns
    Type Description
    MapperBuilder<TFrom, TTo>

    Returns this mapper.

    Type Parameters
    Name Description
    T

    Type to map.

    | Improve this Doc View Source

    ToMapping<T>(String, String)

    Defines member name mapping for destination types.

    Declaration
    public MapperBuilder<TFrom, TTo> ToMapping<T>(string memberName, string mapName)
    Parameters
    Type Name Description
    System.String memberName

    Type member name.

    System.String mapName

    Mapping name.

    Returns
    Type Description
    MapperBuilder<TFrom, TTo>

    Returns this mapper.

    Type Parameters
    Name Description
    T

    Type to map.

    Explicit Interface Implementations

    | Improve this Doc View Source

    IMapperBuilder.GetMapperLambdaExpression()

    Declaration
    LambdaExpression IMapperBuilder.GetMapperLambdaExpression()
    Returns
    Type Description
    LambdaExpression
    | Improve this Doc View Source

    IMapperBuilder.GetMapperLambdaExpressionEx()

    Declaration
    LambdaExpression IMapperBuilder.GetMapperLambdaExpressionEx()
    Returns
    Type Description
    LambdaExpression

    Implements

    IMapperBuilder

    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