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

Explicit mapping #18

Merged
merged 3 commits into from
Jan 21, 2016
Merged

Explicit mapping #18

merged 3 commits into from
Jan 21, 2016

Conversation

chaowlert
Copy link
Collaborator

Hi eric, please help review this PR. This PR included your change on extension method. By merging this PR will accept your PR.

I don't fully understand how RequireExplicitMapping works.
From what I understand after your posted issues is RequireExplicitMapping will only apply to Class (not List and Primitive).

Here is scenario.

class Parent {
    public string Id { get; set; }
    public List<Child> Items { get; set; }
}
class Child {
    public List<int> Blah { get; set; }
}

var result = TypeAdapter.Adapt<Parent[], List<Parent>>(src);

if we have only TypeAdaptConfig<Parent, Parent>, we will throw explicit alert on (Child, Child).

But if we have both TypeAdaptConfig<Parent, Parent> and TypeAdaptConfig<Child, Child>, mapping will be succeeded (we will not validate list and primitives).

@chaowlert
Copy link
Collaborator Author

PS. Could you help configure AppVayor to build only Mapster.sln?

@eric-swann-q2
Copy link
Contributor

I think the behavior you have described here is as designed...I believe this is as it should be in this case.

@eric-swann-q2
Copy link
Contributor

I'll take a look at appveyor

@eswann
Copy link
Collaborator

eswann commented Jan 21, 2016

AppVeyor is fixed...I"m going to merge this pull request and do some more testing on it.

eswann added a commit that referenced this pull request Jan 21, 2016
@eswann eswann merged commit 61faf22 into MapsterMapper:master Jan 21, 2016
@chaowlert chaowlert deleted the explicit-mapping branch January 21, 2016 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants