public ReflectionBasedControllerProvider(IHostingBridge source)
		{
			var assemblies = source.ReferencedAssemblies;

			// very naive impl
			_validTypes = new List<Tuple<string, Type>>(
				assemblies
					.SelectMany(a => a.GetTypes())
					.Where(t => t.Name.EndsWith("Controller") && !t.IsAbstract)
					.Select(t => new Tuple<string, Type>(t.Name.Substring(0, t.Name.Length - "Controller".Length).ToLowerInvariant(), t)));
		}
        public ReflectionBasedControllerProvider(IHostingBridge source)
        {
            Contract.Requires(source != null);
            Contract.EndContractBlock();

            _validTypes = new List<Tuple<string, Type>>(
                source.ReferenceAssemblies.SelectMany(a => a.GetTypes()).
                    Where(t => t.Name.EndsWith("Controller") && !t.IsAbstract).
                    Select(t => new Tuple<string, Type>(
                        t.Name.Substring(0, t.Name.Length - "Controller".Length).ToLowerInvariant(), t)));
        }
Esempio n. 3
0
 public RazorView(IHostingBridge hostingBridge, string view, string layout)
 {
     this.ViewPath = view;
     this.LayoutPath = layout;
     this._hostingBridge = hostingBridge;
 }
Esempio n. 4
0
		public RazorView(IHostingBridge hostingBridge, string view, string layout)
		{
			ViewPath = view;
			LayoutPath = layout;
			HostingBridge = hostingBridge;
		}