JasperFx / lamar

Fast Inversion of Control Tool and Successor to StructureMap
https://jasperfx.github.io/lamar
MIT License
563 stars 118 forks source link

Using Lamar with Npgsql / Npgsql.NodaTime fails to resolve services required for the Npgsql.NodeTime plugin #381

Closed CodingGorilla closed 1 year ago

CodingGorilla commented 1 year ago

This is related to an issue I opened here: https://github.com/npgsql/efcore.pg/issues/2717

The problem seems to be that after updating to .Net 7, EFCore 7 and Npgsql 7 with Lamar 11.1.2 (from Lamar 10.0.1) the Npgsql.NodaTime plugin no longer seems to work properly. I created a small reproduction project for the above issue and it works fine. The only significant difference between the main solution and the repro project is the use of Lamar. After a lot of digging and troubleshooting it seems like many of the required Npgsql.NodaTime services are not being properly registered.

Even after explicitly calling the AddEntityFrameworkNpgsqlNodaTime() extension method provided by the Npgsql.NodaTime package, the services are not being added. I'm trying to downgrade to Lamar 10.0.1 to see if that makes a difference, but it causes some other exceptions in the solution (probably a cross dependency issue). In the mean time, if there any suggestions as to where to look they would be appreciated.

CodingGorilla commented 1 year ago

Sorry, after about 10 hours of digging I tracked down the issue and it is not related to Lamar (it's Marten! 😂)