Пример #1
0
        public static void RegisterPartials(this FubuRegistry registry, Action <IPartialViewTypeRegistrationExpression> registration)
        {
            registry.Services(x =>
            {
                x.SetServiceIfNone <IPartialViewTypeRegistry>(new PartialViewTypeRegistry());
                var partialRegistry = x.FindAllValues <IPartialViewTypeRegistry>().FirstOrDefault();

                var expression = new PartialViewTypeRegistrationExpression(partialRegistry);
                registration(expression);
            });
        }
Пример #2
0
        public static void RegisterPartials(this FubuRegistry registry,
                                            Action <IPartialViewTypeRegistrationExpression> registration)
        {
            registry.Configure(x =>
            {
                var services = x.Services;

                services.SetServiceIfNone(typeof(IPartialViewTypeRegistry), ObjectDef.ForValue(new PartialViewTypeRegistry()));
                var partialRegistry = services.FindAllValues <IPartialViewTypeRegistry>().FirstOrDefault();

                var expression = new PartialViewTypeRegistrationExpression(partialRegistry);
                registration(expression);
            });
        }