diff --git a/src/OdeToCode.AddFeatureFolders/FeatureFolderOptions.cs b/src/OdeToCode.AddFeatureFolders/FeatureFolderOptions.cs index 73fb00a..2e7b080 100644 --- a/src/OdeToCode.AddFeatureFolders/FeatureFolderOptions.cs +++ b/src/OdeToCode.AddFeatureFolders/FeatureFolderOptions.cs @@ -13,6 +13,7 @@ public FeatureFolderOptions() FeatureFolderName = "Features"; DeriveFeatureFolderName = null; FeatureNamePlaceholder = "{Feature}"; + DefaultViewLocation = @"\Features\{0}\{1}.cshtml"; } /// @@ -39,5 +40,12 @@ public FeatureFolderOptions() /// replaces {feature} with the feature path derived from the ControllerModel /// public string FeatureNamePlaceholder { get; set; } + + /// + /// The default view location. Helps intellisense find razor views. Example: + /// "\Features\{0}\{1}.cshtml". + /// Razor replaces the controller name into {0} placeholder & view name into the {1} placeholder. + /// + public string DefaultViewLocation { get; set; } } } diff --git a/src/OdeToCode.AddFeatureFolders/ServiceCollectionExtensions.cs b/src/OdeToCode.AddFeatureFolders/ServiceCollectionExtensions.cs index 3b6ae44..694c51c 100644 --- a/src/OdeToCode.AddFeatureFolders/ServiceCollectionExtensions.cs +++ b/src/OdeToCode.AddFeatureFolders/ServiceCollectionExtensions.cs @@ -29,6 +29,7 @@ public static IMvcBuilder AddFeatureFolders(this IMvcBuilder services, FeatureFo o.ViewLocationFormats.Clear(); o.ViewLocationFormats.Add(options.FeatureNamePlaceholder + @"\{0}.cshtml"); o.ViewLocationFormats.Add(options.FeatureFolderName + @"\Shared\{0}.cshtml"); + o.ViewLocationFormats.Add(options.DefaultViewLocation); o.ViewLocationExpanders.Add(expander); });