Example #1
0
        private static void End()
        {
            if (Current == null)
            {
                throw new NotSupportedException("No active unit of work");
            }

            current = null;
        }
Example #2
0
        public static UoWScope Create()
        {
            if (Current != null)
            {
                throw new NotSupportedException("Can not nest unit of works");
            }

            DomainEvents.Init();
            SubscribeToDomainEvents();
            current = UoWFactory();

            return(new UoWNewScope());
        }