Ejemplo n.º 1
0
 public void Dispose()
 {
     if (ThreadData.Contains(Key))
     {
         var stack = ThreadData.GetClass <Stack <string> >(Key);
         stack.Pop();
         ThreadData.SetValue(Key, stack);
     }
 }
Ejemplo n.º 2
0
            public DepthCheck(int maxDepth, Type type)
            {
                Stack <string> stack = new Stack <string>();

                if (ThreadData.Contains(Key))
                {
                    stack = ThreadData.GetClass <Stack <string> >(Key);
                }
                stack.Push(type.FullName);
                if (stack.Count > maxDepth)
                {
                    throw new MapperStackException(Constants.Errors.LazyLoop.Formatted(
                                                       stack.Aggregate((x, y) => "{0}{1}\n\r".Formatted(x, y))
                                                       ));
                }
                ThreadData.SetValue(Key, stack);
            }