Base solution for your next web application
Open Closed

Custom unit of work class #4102


User avatar
0
fadwell created

Hello!

I'm wondering how EfCoreUnitOfWork is registered, and what is the best option to register my custom(extended) UoW that inherited from EfCoreUnitOfWork?

Thanks!


2 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    It is registered by convention because it implements ITransientDependency. If you define your custom UoW in the same way, it will be registered by default.

    If you want to replace existing UoW class with your version, You can do it in the PreInitialize method of your module using below syntax.

    Configuration.ReplaceService<EfCoreUnitOfWork, YourEfCoreUnitOfWork>(DependencyLifeStyle.Transient);
    
  • User Avatar
    0
    fadwell created

    Oh, I got it!

    Thank you for clarifying!!