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

Synchronous configuration with Autofac #350

Open
RustyF opened this issue Mar 10, 2020 · 2 comments
Open

Synchronous configuration with Autofac #350

RustyF opened this issue Mar 10, 2020 · 2 comments

Comments

@RustyF
Copy link

RustyF commented Mar 10, 2020

Regarding the removal of all sync methods, Autofac configuration is synchronous and thus means we can't do this anymore:-

builder .Register<NeoServerConfiguration>(context => NeoServerConfiguration.GetConfiguration(uri, user, pwd)) .SingleInstance();

Is there an obvious workaround I've missed?

@RustyF RustyF changed the title Synchronous configuration Synchronous configuration with Autofac Mar 10, 2020
@RustyF
Copy link
Author

RustyF commented Mar 10, 2020

Btw, I'm using 4.x preview. Gonna switch to 3.x for now.

@cskardon
Copy link
Member

The only solution I can think of is using your own mediator to wrap the async code synchronously. This is all the sync versions in 3.x do, and looks like it's been written about here: https://greatrexpectations.com/2016/04/22/autofac-and-async-resources ??

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

No branches or pull requests

2 participants