DotNet4Neo4j / Neo4jClient

.NET client binding for Neo4j
https://www.nuget.org/packages/Neo4jClient
Microsoft Public License
430 stars 146 forks source link

Synchronous configuration with Autofac #350

Open RustyF opened 4 years ago

RustyF commented 4 years ago

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 commented 4 years ago

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

cskardon commented 3 years ago

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 ??