View Single Post
  #3 (permalink)  
Old May 19th, 2014, 09:46 AM
sb9242 sb9242 is offline
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: May 2014
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default UnitOfWork confusion

Thanks Jon

The way you have done it makes sense. The repository and service are injected with the same unitofWork.
I used dependency injection in the same way as the example and Agatha's example.
In the Agathas.Storefront OrderService the UnitOFWork is injected in the constructor

public OrderService(IOrderRepository orderRepository,
IBasketRepository basketRepository,
ICustomerRepository customerRepository,
IUnitOfWork uow)
_customerRepository = customerRepository;
_orderRepository = orderRepository;
_basketRepository = basketRepository;
_uow = uow;

The OrderService binds to the concrete implementation UnitOfWork as per the details in BootStrapper as would the repositories. As I see it these would
be different UnitOfWork instances.
Does it work for you using the DI framework.
Reply With Quote