Replies: 1 comment 2 replies
-
|
I prefer using separated methods or extension methods instead of inheriting from user manager @mohabbati |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
In TodoTemplate project, there are two methods that send email to the user for an email confirmation and reset password. To avoid repetitive sending emails, we need to add delay for it. I suggest the following implementation:
DateTimeOffsetdata type in theUserclass.UserManager<TUser>class and then add two methods (one for email confirmation and another one for reset password) that return abooleanvalue that is it ok to send email?DateTimeOffset.Nowand compare it with the delay value. Finally, it returns aboolresult.SendConfirmationEmailandSendResetPasswordEmailmethods. If the result is true then an email sends to the user otherwise not.Next, in another refactoring we can move the
SendConfirmationEmailandSendResetPasswordEmailmethods to theUserManagerExtensionsclassNote that by using the extension method instead of inheritance we have less refactoring.
What do you think about it?
@ysmoradi @msynk
Beta Was this translation helpful? Give feedback.
All reactions