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

Add Mapper.Reset back #2404

Closed
jbogard opened this Issue Nov 15, 2017 · 4 comments

Comments

Projects
None yet
4 participants
@jbogard
Member

jbogard commented Nov 15, 2017

To support calling Mapper.Initialize multiple times, explicitly allow Reset

See discussion on #2399

@jbogard

This comment has been minimized.

Show comment
Hide comment
@urasaber

This comment has been minimized.

Show comment
Hide comment
@urasaber

urasaber Nov 16, 2017

@jbogard so why did you guys implemented it that way that the Instance or Configuration properties throw exceptions from getter? Just return nulls if mapper is not initialized and then everyone can just check Instance == null to call Initialize once

Currently there's no way to check or ensure that mapper is not initialized except using try-catch

urasaber commented Nov 16, 2017

@jbogard so why did you guys implemented it that way that the Instance or Configuration properties throw exceptions from getter? Just return nulls if mapper is not initialized and then everyone can just check Instance == null to call Initialize once

Currently there's no way to check or ensure that mapper is not initialized except using try-catch

@lbargaoanu

This comment has been minimized.

Show comment
Hide comment
@lbargaoanu

lbargaoanu Nov 16, 2017

Member

It was a convenience thing (for us), but anyway, there is no need for that check. In theory, after that check, somebody else could have called initialize, so the check is useless. It should be easy to ensure Initialize is only called once using smth like Lazy.

Member

lbargaoanu commented Nov 16, 2017

It was a convenience thing (for us), but anyway, there is no need for that check. In theory, after that check, somebody else could have called initialize, so the check is useless. It should be easy to ensure Initialize is only called once using smth like Lazy.

@jbogard jbogard closed this in 5f0cf4f Nov 16, 2017

@mrmkamranmalik

This comment has been minimized.

Show comment
Hide comment
@mrmkamranmalik

mrmkamranmalik Apr 4, 2018

Thanks for Adding Mapper.Reset(), it make my life easy :-)

mrmkamranmalik commented Apr 4, 2018

Thanks for Adding Mapper.Reset(), it make my life easy :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment