private static void End() { if (Current == null) { throw new NotSupportedException("No active unit of work"); } current = null; }
public static UoWScope Create() { if (Current != null) { throw new NotSupportedException("Can not nest unit of works"); } DomainEvents.Init(); SubscribeToDomainEvents(); current = UoWFactory(); return(new UoWNewScope()); }