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

Support disposal of objects returned by RegisterFactoryAs #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jonathansapp
Copy link

@gasparnagy

BoDi does not currently provide any way to track and automatically dispose of objects returned from factory delegates. The following code changes enable this functionality while preserving the existing behavior.

The purpose of this PR is to make the changes necessary so that AutoFac lifetime scopes can be properly disposed between scenarios. See open SpecFlow issue Lifetime is Incorrect #12.

Usage:

void RegisterFactoryAs<TInterface>(Func<IObjectContainer, TInterface> factoryDelegate, string name = null, bool dispose = false)

@gasparnagy
Copy link
Collaborator

@jonathansapp Thx! Could you please also add a line about this change to the bodi.cs header (change history)?

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.

2 participants