Пример #1
0
        /// <summary>
        /// Instruct the view attachment mechanism to include views from all packages.
        /// </summary>
        public ViewExpression TryToAttachViewsInPackages()
        {
            _registry.ConfigureImports(i =>
            {
                var importAttacher   = i.Views._viewAttacher;
                var importConvention = i.Views._viewAttacherConvention;

                if (!importAttacher.Facilities.Any())
                {
                    _viewAttacherConvention
                    .Filters
                    .Each(importConvention.AddViewsForActionFilter);
                }

                _viewAttacher
                .Facilities
                .Each(importAttacher.AddFacility);
            });

            return(this);
        }