public FormatStringTest() { _yueluo = Yueluo.Create(); var _ = _yueluo.FormatToString(); _cachedObjectVisitor = _yueluo.V() .WithExtendObject <Yueluo, StringBuilder>() .ForEach((name, value, sb) => sb.AppendFormat("{0}:{1}{2}", name, value, Environment.NewLine)) .Cache(); }
public string NoCacheVisitor() { var sb = new StringBuilder(); _yueluo .V() .WithExtendObject(sb) .ForEach((name, value, s) => s.AppendFormat("{0}:{1}{2}", name, value, Environment.NewLine)) .Run(); return(sb.ToString()); }
public CacheVisitorTest() { _yueluo = Yueluo.Create(); var _ = _yueluo.FormatToString(); _cachedObjectVisitor = _yueluo.V() .WithExtendObject <Yueluo, StringBuilder>() .ForEach((name, value, sb) => sb.AppendFormat("{0}:{1}{2}", name, value, Environment.NewLine)) .Cache(); _propertyInfos = typeof(Yueluo).GetProperties(); }