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

AutoMapper vs AnyClone #13

Open
sigmarsson opened this issue Feb 25, 2021 · 1 comment
Open

AutoMapper vs AnyClone #13

sigmarsson opened this issue Feb 25, 2021 · 1 comment

Comments

@sigmarsson
Copy link

It is merely a question rather than a bug or issue.

Is AnyClone preferred over AutoMapper.Map<T, T>() method ? Without being too specific.

And being a little more; do you actually handle anytihing special around properties like ;

        [BsonId]
        public long Id { get; set; }
@replaysMike
Copy link
Owner

replaysMike commented Feb 26, 2021

They aren't functionally much different. AutoMapper can implicitly map without a mapping definition. If the object types are different, but have the same names it can also clone from one to another. Essentially, this is cloning an object's contents (private fields, properties, collections etc). AnyClone utilizes reflection to copy an object's contents recursively including some hairy details that are needed to clone more complex structures and it's fairly efficient.

Performance wise, it's about the same as AutoMapper. Similarly I have another package called AnySerializer which instead of copying using reflection it serializes the data to a byte structure (similar to Protobuf) but does so without any decorative attributes and can handle a wide range of complex objects.

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

2 participants