Ejemplo n.º 1
0
        public static BlockWritingContext ContextFor <T>(Expression <Func <T, object> > expression, object subject = null)
        {
            var property = ReflectionHelper.GetProperty(expression);

            var services = new InMemoryServiceLocator();

            services.Add <IDisplayFormatter>(new DisplayFormatter(services, new Stringifier()));

            var context = new BlockWritingContext(services, ObjectBlockWriter.Basic(), BlockRegistry.Basic(), subject);

            context.StartProperty(property);

            return(context);
        }