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

[Feature Request] add api to get differents properties(or fields) when map to exists dst? #477

Open
sgf opened this issue Sep 14, 2022 · 1 comment

Comments

@sgf
Copy link

sgf commented Sep 14, 2022

Could be add some api to compare differents properties(or fields) with two instance of same class ?
i know we can use reflection,but performance slow.

like:

//same class  (ClassAObj1 vs ClassAObj2)
var fieldNames= ClassAObj1.Diff(ClassAObj2);  //Api-1 get different fieldnames,but not map
bool hasDifferents= ClassAObj1.MapDiff(ClassAObj2,out string[] fieldsName);  //Api-2 get get different fieldnames and map them
//not same class (ClassAObj1 vs ClassBObj2)
var fieldNames= ClassAObj1.Diff(ClassBObj2);  //Api-1 get different fieldnames,but not map
bool hasDifferents= ClassAObj1.MapDiff(ClassBObj2,out string[] fieldsName);  //Api-2 get get different fieldnames and map them

//same like mapper's config it will use the global config(custom ignore some properties(or fields) ),that's will be better.

why need:
if i got not differents,then i wont need to update to database.

@sgf sgf changed the title Could be add some api to compare differents properties(or fields) with two instance of same class ? [Feature Request] add api to get differents properties(or fields) when map to exists dst instance of same class as src? Nov 10, 2022
@sgf sgf changed the title [Feature Request] add api to get differents properties(or fields) when map to exists dst instance of same class as src? [Feature Request] add api to get differents properties(or fields) when map to exists dst? Nov 10, 2022
@sgf
Copy link
Author

sgf commented Nov 23, 2022

mark a link agileobjects/AgileMapper#229

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

No branches or pull requests

1 participant