Quantcast
Channel: URF - Unit of Work & (extensible/generic) Repositories Framework
Viewing all articles
Browse latest Browse all 1539

New Post: Registering IoC in a Bounded Context scenario

$
0
0
I have an app using the IObjectState in my entities (got the idea from Julie Lerman). I really like your framework implementation and had to take advantage. I'm using it with Bounded Contexts and I'm using Autofac for IoC registration in an API.

When trying to register a second context with its services in Autofac, it throws an error. Problem is trying to register multiple DbContexts with same IDataContextAsync.

I tried duplicating it in this solution by adding a bounded context. I added a copy of NorthwindContext to NorthwindContext2 and tried registering it in Unity.
  • .RegisterType<IDataContextAsync, NorthwindContext2>(new PerRequestLifetimeManager())
    When trying to access the Customer View, an error is thrown.
Is it possible to register multiple contexts in Unity and associate the IRepositories and IServices registration to a specific context registration?

Thank you in advance,
Ronnie

Viewing all articles
Browse latest Browse all 1539

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>