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

Map fields without properties #543

Open
bahmanbs opened this issue Apr 26, 2023 · 0 comments
Open

Map fields without properties #543

bahmanbs opened this issue Apr 26, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@bahmanbs
Copy link

Is your feature request related to a problem? Please describe.

it is not a problem, but a new feature.

EF Core in c# let us map database table to private fields without a setter property.

destination class only exposes a public getter. this feature in EF COre is called backing field.

we need such a feature in automapper in typescript for pojos or classes too .

Describe the solution you'd like

in mapping configuration we need a new method called "forPrivateMember" or something like that.
it could be an alias for "forMember" method, the difference is that, the new name makes more sense, it could also be a completely new method that writes to private field of destination class/pojo.

for this true for source too. a new method called "mapFromPrivateField" or something like that, it can read from private field of source class/pojo.

Describe alternatives you've considered

No response

Additional context

more about this feature in EF Core documentation is here
this page shows use case of this feature too.

@bahmanbs bahmanbs added the enhancement New feature or request label Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant