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

Create IMailSender per request and not per instance #5835

Merged
merged 3 commits into from
Apr 20, 2018
Merged

Create IMailSender per request and not per instance #5835

merged 3 commits into from
Apr 20, 2018

Conversation

skofman1
Copy link
Contributor

Fixes: #5816

There's no "expensive" initializations in the ctors, so no problem in initializing per request.

@@ -265,8 +265,7 @@ protected override void Load(ContainerBuilder builder)
.Refresh());
}

var mailSenderThunk = new Lazy<IMailSender>(
() =>
Func<MailSender> mailSenderFacotry = () =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Factory

@@ -265,8 +265,7 @@ protected override void Load(ContainerBuilder builder)
.Refresh());
}

var mailSenderThunk = new Lazy<IMailSender>(
() =>
Func<MailSender> mailSenderFacotry = () =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C# supports methods declared inside methods (forgot what's the "official" name), should we declare one instead of a delegate?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skofman1 skofman1 merged commit 18bf1b4 into dev Apr 20, 2018
@skofman1 skofman1 deleted the fix5816 branch April 20, 2018 23:40
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

Successfully merging this pull request may close these issues.

None yet

4 participants