Fixing RazorViewEngine formatting

This commit is contained in:
Pranav K 2015-09-08 15:52:53 -07:00
parent 1c8f22058c
commit 67eb16dc67
1 changed files with 25 additions and 17 deletions

View File

@ -48,10 +48,11 @@ namespace Microsoft.AspNet.Mvc.Razor
/// Initializes a new instance of the <see cref="RazorViewEngine" /> class. /// Initializes a new instance of the <see cref="RazorViewEngine" /> class.
/// </summary> /// </summary>
/// <param name="pageFactory">The page factory used for creating <see cref="IRazorPage"/> instances.</param> /// <param name="pageFactory">The page factory used for creating <see cref="IRazorPage"/> instances.</param>
public RazorViewEngine(IRazorPageFactory pageFactory, public RazorViewEngine(
IRazorViewFactory viewFactory, IRazorPageFactory pageFactory,
IOptions<RazorViewEngineOptions> optionsAccessor, IRazorViewFactory viewFactory,
IViewLocationCache viewLocationCache) IOptions<RazorViewEngineOptions> optionsAccessor,
IViewLocationCache viewLocationCache)
{ {
_pageFactory = pageFactory; _pageFactory = pageFactory;
_viewFactory = viewFactory; _viewFactory = viewFactory;
@ -98,8 +99,9 @@ namespace Microsoft.AspNet.Mvc.Razor
} }
/// <inheritdoc /> /// <inheritdoc />
public ViewEngineResult FindView([NotNull] ActionContext context, public ViewEngineResult FindView(
string viewName) [NotNull] ActionContext context,
string viewName)
{ {
if (string.IsNullOrEmpty(viewName)) if (string.IsNullOrEmpty(viewName))
{ {
@ -111,8 +113,9 @@ namespace Microsoft.AspNet.Mvc.Razor
} }
/// <inheritdoc /> /// <inheritdoc />
public ViewEngineResult FindPartialView([NotNull] ActionContext context, public ViewEngineResult FindPartialView(
string partialViewName) [NotNull] ActionContext context,
string partialViewName)
{ {
if (string.IsNullOrEmpty(partialViewName)) if (string.IsNullOrEmpty(partialViewName))
{ {
@ -124,8 +127,9 @@ namespace Microsoft.AspNet.Mvc.Razor
} }
/// <inheritdoc /> /// <inheritdoc />
public RazorPageResult FindPage([NotNull] ActionContext context, public RazorPageResult FindPage(
string pageName) [NotNull] ActionContext context,
string pageName)
{ {
if (string.IsNullOrEmpty(pageName)) if (string.IsNullOrEmpty(pageName))
{ {
@ -148,7 +152,9 @@ namespace Microsoft.AspNet.Mvc.Razor
/// <see cref="ActionDescriptor.RouteConstraints"/> for traditional routes to get route values produces /// <see cref="ActionDescriptor.RouteConstraints"/> for traditional routes to get route values produces
/// consistently cased results. /// consistently cased results.
/// </remarks> /// </remarks>
public static string GetNormalizedRouteValue([NotNull] ActionContext context, [NotNull] string key) public static string GetNormalizedRouteValue(
[NotNull] ActionContext context,
[NotNull] string key)
{ {
object routeValue; object routeValue;
if (!context.RouteData.Values.TryGetValue(key, out routeValue)) if (!context.RouteData.Values.TryGetValue(key, out routeValue))
@ -191,9 +197,10 @@ namespace Microsoft.AspNet.Mvc.Razor
return stringRouteValue; return stringRouteValue;
} }
private RazorPageResult GetRazorPageResult(ActionContext context, private RazorPageResult GetRazorPageResult(
string pageName, ActionContext context,
bool isPartial) string pageName,
bool isPartial)
{ {
if (IsApplicationRelativePath(pageName)) if (IsApplicationRelativePath(pageName))
{ {
@ -303,9 +310,10 @@ namespace Microsoft.AspNet.Mvc.Razor
return new RazorPageResult(pageName, searchedLocations); return new RazorPageResult(pageName, searchedLocations);
} }
private ViewEngineResult CreateViewEngineResult(RazorPageResult result, private ViewEngineResult CreateViewEngineResult(
IRazorViewFactory razorViewFactory, RazorPageResult result,
bool isPartial) IRazorViewFactory razorViewFactory,
bool isPartial)
{ {
if (result.SearchedLocations != null) if (result.SearchedLocations != null)
{ {