private static ViewLocationResult LocateViewAndSupressExceptions(IViewSourceProvider viewSourceProvider, string viewName, IEnumerable<string> supportedViewEngineExtensions) { try { return viewSourceProvider.LocateView(viewName, supportedViewEngineExtensions); } catch (Exception) { return null; } }
private static ViewLocationResult LocateViewAndSupressExceptions(IViewSourceProvider viewSourceProvider, string viewName, IEnumerable <string> supportedViewEngineExtensions) { try { return(viewSourceProvider.LocateView(viewName, supportedViewEngineExtensions)); } catch (Exception) { return(null); } }
/// <summary> /// Configures the bootstrapper to use the provided instance of <see cref="IViewSourceProvider"/>. /// </summary> /// <param name="viewSourceProvider">The <see cref="IViewSourceProvider"/> instance that should be used by the bootstrapper.</param> /// <returns>An instance to the current <see cref="FakeNancyBootstrapperConfigurator"/>.</returns> public FakeNancyBootstrapperConfigurator ViewSourceProvider(IViewSourceProvider viewSourceProvider) { this.bootstrapper.configuredEnumerableInstances[typeof(IViewSourceProvider)] = new[] { viewSourceProvider }; return(this); }