riteshrao / ncommon

A framework for implementing commonly used design patterns when using Domain Driven Design
www.codeinsanity.com
218 stars 61 forks source link

V1.2 NCommon without ServiceLocator #34

Closed apavlychev closed 11 years ago

apavlychev commented 11 years ago

Hey! We try to use NCommon for our project but we have a several composition root. Therefore we can't to define a global ServiceLocator. I 've found that It's possible to override UnitOfWorkScope, TransactionManager and LinqToSqlRepository to replace ServiceLocator.Current on IUnityContainer. But LinqToSqlRepository (and other) have a bad dependency in constructor, although there is a check ServiceLocator.Current !=null (btw throw exception if ServiceLocator isn't set ) but It'll have risk that somebody set once. I offer to add a several virtual methods to clear NCommon.

apavlychev commented 11 years ago

I can send examples if u will write ur e-mail

riteshrao commented 11 years ago

Merged. Thank you.

apavlychev commented 11 years ago

Thx m8! I would add examples but NCommon's google group don't allow - all my message are rejected ;(