Skip to content

The implementation of Unit-Of-Work pattern behaviour using unity interception

License

Notifications You must be signed in to change notification settings

semashkinvg/UnitOfWork.Unity.Inteception

Repository files navigation

UnitOfWork.Unity.Inteception Build Status

The implementation of Unit-Of-Work pattern behaviour using unity interception

Example

var uc = new UnityContainer();
uc.AddNewExtension<Interception>();

// the unit of work has been registered as per scope.
uc.RegisterType<IUnitOfWork, YourUoWImplementation>(new SomePerScopeLifeTimeManager());
// by the specifying interceptor to a specific implementation, you can group some operations into one transaction.
uc.RegisterType<IDummyService, DummyService>(
    new Interceptor<InterfaceInterceptor>(), new InterceptionBehavior<UoWInterceptionBehavior<IUnitOfWork>>());