Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/OdeToCode.AddFeatureFolders/FeatureFolderOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public FeatureFolderOptions()
FeatureFolderName = "Features";
DeriveFeatureFolderName = null;
FeatureNamePlaceholder = "{Feature}";
DefaultViewLocation = @"\Features\{0}\{1}.cshtml";
}

/// <summary>
Expand All @@ -39,5 +40,12 @@ public FeatureFolderOptions()
/// replaces {feature} with the feature path derived from the ControllerModel
/// </summary>
public string FeatureNamePlaceholder { get; set; }

/// <summary>
/// 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.
/// </summary>
public string DefaultViewLocation { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down