Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic types mapping #98

Closed
RaYell opened this issue Jan 26, 2017 · 1 comment
Closed

Generic types mapping #98

RaYell opened this issue Jan 26, 2017 · 1 comment

Comments

@RaYell
Copy link

RaYell commented Jan 26, 2017

Is there any chance Mapster can map generic types? Something like.

config.ForType<SourceGeneric<T>, DestinationGeneric<T>>().Map(...)

MyGenericType<string> myType = new MyGenericType<string>();
myType.Adapt<MyOtherGenericType<string>>();

What I mean is I don't want to configure all potential types of T separately and would like to just define "generic mapping" between the types that will handle all types of T.

@chaowlert
Copy link
Collaborator

Mapster 3.0 now you can create config using generic definition (https://github.com/chaowlert/Mapster/wiki/Configuration#open-generics).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants