Skip to content

Add an overload to the Adapt method to allow using a local, temporary configuration. #833

@roohial57

Description

@roohial57

Previously, I added two overload for method Adapt that locally and temporarily modified the global configuration.

public static TDestination Adapt<TDestination>(this object? source, Action<TypeAdapterConfig> configAction)
public static TDestination Adapt<TSource, TDestination>(this object? source, Action<TypeAdapterSetter<TSource, TDestination>> configAction)

What do you think about adding the following the overload to modify an existing object?
public static TDestination Adapt<TSource, TDestination>(this object? source, TDestination destination, Action<TypeAdapterSetter<TSource, TDestination>> SetterAction)

And add an overload to ProjectToType method that locally and temporarily modified the global configuration.
The proposed overload:
public static IQueryable<TDestination> ProjectToType<TDestination>(this IQueryable source, TypeAdapterConfig? config = null, Action<TypeAdapterSetter<TSource, TDestination>> SetterAction)

Of course, the following method already exists in the current version and uses a config instead of the global setting.
public static IQueryable ProjectToType(this IQueryable source, Type destinationType, TypeAdapterConfig? config = null)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions