MapsterMapper / MapsterMapper/Mapster

Properties do not map properly

Open
#407 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug waiting for info
Dominant language
C#
Stars
5.2k
Forks
410
Avg merge
2d 12h
Merged PRs (30d)
6

Description

I have a class `A` that has a `DateTime` property, and class `B` that has a `long` property.
Both properties have the same name.
I've setup the rule for type `DateTime` converting to `long` in a config `C1` which implements `IRegister` interface.
And of course a config `C2` for `A` converting to `B`
But when I map from `A` to `B`, that `DateTime` property will always 0, unless I set the mapping rule in config `C2`.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Reproduce the mapping with classes A and B, configurations C1 and C2, and the DateTime-to-long rule; done means the property maps correctly when the conversion is registered only in C1.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.