tugberkugurlu / AspNetCore.Identity.MongoDB

MongoDB Data Store Adaptor for ASP.NET Core Identity
MIT License
229 stars 69 forks source link

Make a guard class #17

Closed SebastianStehle closed 6 years ago

SebastianStehle commented 8 years ago

It is not an issue, but it would help to make a guard class:

https://github.com/aspnet/EntityFramework/blob/dev/src/Shared/Check.cs

My impression is, that 50% of the code is for the checking preconditions ;)

tugberkugurlu commented 8 years ago

My impression is, that 50% of the code is for the checking preconditions ;)

:smile: yes, that could be true. I guess I get fastidious when it comes to Guard methods as it changes the stack trace but I can see your point, too + it doesn't alter the stack trace that much, you can still see where the Guard method is being called.

Feel free to have a go on this and send a pull request if you want to.

dealproc commented 6 years ago

May consider the use of https://github.com/danielwertheim/Ensure.That for this item. Why implement code that is already implemented and working in various projects already?

dealproc commented 6 years ago

In my fork... will be pushing in the next few days after some additional work is put to-bed.