Skip to content

Commit ab74f24

Browse files
committed
Add comment
1 parent 0ca4688 commit ab74f24

File tree

2 files changed

+77
-72
lines changed

2 files changed

+77
-72
lines changed

src/Mvc/Mvc.RazorPages/src/PageBase.cs

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public virtual ContentResult Content(string content)
217217
=> Content(content, (MediaTypeHeaderValue)null);
218218

219219
/// <summary>
220-
/// Creates a <see cref="ContentResult"/> object with <see cref="StatusCodes.Status200OK"/> by specifying a
220+
/// Creates a <see cref="ContentResult"/> object with <see cref="StatusCodes.Status200OK"/> by specifying a
221221
/// <paramref name="content"/> string and a content type.
222222
/// </summary>
223223
/// <param name="content">The content to write to the response.</param>
@@ -227,7 +227,7 @@ public virtual ContentResult Content(string content, string contentType)
227227
=> Content(content, MediaTypeHeaderValue.Parse(contentType));
228228

229229
/// <summary>
230-
/// Creates a <see cref="ContentResult"/> object with <see cref="StatusCodes.Status200OK"/> by specifying a
230+
/// Creates a <see cref="ContentResult"/> object with <see cref="StatusCodes.Status200OK"/> by specifying a
231231
/// <paramref name="content"/> string, a <paramref name="contentType"/>, and <paramref name="contentEncoding"/>.
232232
/// </summary>
233233
/// <param name="content">The content to write to the response.</param>
@@ -246,7 +246,7 @@ public virtual ContentResult Content(string content, string contentType, Encodin
246246
}
247247

248248
/// <summary>
249-
/// Creates a <see cref="ContentResult"/> object with <see cref="StatusCodes.Status200OK"/> by specifying a
249+
/// Creates a <see cref="ContentResult"/> object with <see cref="StatusCodes.Status200OK"/> by specifying a
250250
/// <paramref name="content"/> string and a <paramref name="contentType"/>.
251251
/// </summary>
252252
/// <param name="content">The content to write to the response.</param>
@@ -293,14 +293,14 @@ public virtual ForbidResult Forbid(params string[] authenticationSchemes)
293293
/// challenge.</param>
294294
/// <returns>The created <see cref="ForbidResult"/> for the response.</returns>
295295
/// <remarks>
296-
/// Some authentication schemes, such as cookies, will convert <see cref="StatusCodes.Status403Forbidden"/> to
296+
/// Some authentication schemes, such as cookies, will convert <see cref="StatusCodes.Status403Forbidden"/> to
297297
/// a redirect to show a login page.
298298
/// </remarks>
299299
public virtual ForbidResult Forbid(AuthenticationProperties properties)
300300
=> new ForbidResult(properties);
301301

302302
/// <summary>
303-
/// Creates a <see cref="ForbidResult"/> (<see cref="StatusCodes.Status403Forbidden"/> by default) with the
303+
/// Creates a <see cref="ForbidResult"/> (<see cref="StatusCodes.Status403Forbidden"/> by default) with the
304304
/// specified authentication schemes and <paramref name="properties" />.
305305
/// </summary>
306306
/// <param name="properties"><see cref="AuthenticationProperties"/> used to perform the authentication
@@ -406,7 +406,7 @@ public virtual PhysicalFileResult PhysicalFile(
406406
=> new PhysicalFileResult(physicalPath, contentType) { FileDownloadName = fileDownloadName };
407407

408408
/// <summary>
409-
/// Creates a <see cref="LocalRedirectResult"/> object that redirects
409+
/// Creates a <see cref="LocalRedirectResult"/> object that redirects
410410
/// (<see cref="StatusCodes.Status302Found"/>) to the specified local <paramref name="localUrl"/>.
411411
/// </summary>
412412
/// <param name="localUrl">The local URL to redirect to.</param>
@@ -439,7 +439,7 @@ public virtual LocalRedirectResult LocalRedirectPermanent(string localUrl)
439439

440440
/// <summary>
441441
/// Creates a <see cref="LocalRedirectResult"/> object with <see cref="LocalRedirectResult.Permanent"/> set to
442-
/// false and <see cref="LocalRedirectResult.PreserveMethod"/> set to true
442+
/// false and <see cref="LocalRedirectResult.PreserveMethod"/> set to true
443443
/// (<see cref="StatusCodes.Status307TemporaryRedirect"/>) using the specified <paramref name="localUrl"/>.
444444
/// </summary>
445445
/// <param name="localUrl">The local URL to redirect to.</param>
@@ -456,7 +456,7 @@ public virtual LocalRedirectResult LocalRedirectPreserveMethod(string localUrl)
456456

457457
/// <summary>
458458
/// Creates a <see cref="LocalRedirectResult"/> object with <see cref="LocalRedirectResult.Permanent"/> set to
459-
/// true and <see cref="LocalRedirectResult.PreserveMethod"/> set to true
459+
/// true and <see cref="LocalRedirectResult.PreserveMethod"/> set to true
460460
/// (<see cref="StatusCodes.Status308PermanentRedirect"/>) using the specified <paramref name="localUrl"/>.
461461
/// </summary>
462462
/// <param name="localUrl">The local URL to redirect to.</param>
@@ -528,7 +528,7 @@ public virtual RedirectResult RedirectPermanent(string url)
528528

529529
/// <summary>
530530
/// Creates a <see cref="RedirectResult"/> object with <see cref="RedirectResult.Permanent"/> set to false
531-
/// and <see cref="RedirectResult.PreserveMethod"/> set to true (<see cref="StatusCodes.Status307TemporaryRedirect"/>)
531+
/// and <see cref="RedirectResult.PreserveMethod"/> set to true (<see cref="StatusCodes.Status307TemporaryRedirect"/>)
532532
/// using the specified <paramref name="url"/>.
533533
/// </summary>
534534
/// <param name="url">The URL to redirect to.</param>
@@ -545,7 +545,7 @@ public virtual RedirectResult RedirectPreserveMethod(string url)
545545

546546
/// <summary>
547547
/// Creates a <see cref="RedirectResult"/> object with <see cref="RedirectResult.Permanent"/> set to true
548-
/// and <see cref="RedirectResult.PreserveMethod"/> set to true (<see cref="StatusCodes.Status308PermanentRedirect"/>)
548+
/// and <see cref="RedirectResult.PreserveMethod"/> set to true (<see cref="StatusCodes.Status308PermanentRedirect"/>)
549549
/// using the specified <paramref name="url"/>.
550550
/// </summary>
551551
/// <param name="url">The URL to redirect to.</param>
@@ -569,7 +569,7 @@ public virtual RedirectToActionResult RedirectToAction(string actionName)
569569
=> RedirectToAction(actionName, routeValues: null);
570570

571571
/// <summary>
572-
/// Redirects (<see cref="StatusCodes.Status302Found"/>) to the specified action using the
572+
/// Redirects (<see cref="StatusCodes.Status302Found"/>) to the specified action using the
573573
/// <paramref name="actionName"/> and <paramref name="routeValues"/>.
574574
/// </summary>
575575
/// <param name="actionName">The name of the action.</param>
@@ -579,7 +579,7 @@ public virtual RedirectToActionResult RedirectToAction(string actionName, object
579579
=> RedirectToAction(actionName, controllerName: null, routeValues: routeValues);
580580

581581
/// <summary>
582-
/// Redirects (<see cref="StatusCodes.Status302Found"/>) to the specified action using the
582+
/// Redirects (<see cref="StatusCodes.Status302Found"/>) to the specified action using the
583583
/// <paramref name="actionName"/> and the <paramref name="controllerName"/>.
584584
/// </summary>
585585
/// <param name="actionName">The name of the action.</param>
@@ -633,15 +633,15 @@ public virtual RedirectToActionResult RedirectToAction(
633633
=> new RedirectToActionResult(actionName, controllerName, routeValues, fragment);
634634

635635
/// <summary>
636-
/// Redirects (<see cref="StatusCodes.Status307TemporaryRedirect"/>) to the specified action with
637-
/// <see cref="RedirectToActionResult.Permanent"/> set to false and <see cref="RedirectToActionResult.PreserveMethod"/>
638-
/// set to true, using the specified <paramref name="actionName"/>, <paramref name="controllerName"/>,
636+
/// Redirects (<see cref="StatusCodes.Status307TemporaryRedirect"/>) to the specified action with
637+
/// <see cref="RedirectToActionResult.Permanent"/> set to false and <see cref="RedirectToActionResult.PreserveMethod"/>
638+
/// set to true, using the specified <paramref name="actionName"/>, <paramref name="controllerName"/>,
639639
/// <paramref name="routeValues"/>, and <paramref name="fragment"/>.
640640
/// </summary>
641641
/// <param name="actionName">The name of the action.</param>
642642
/// <param name="controllerName">The name of the controller.</param>
643643
/// <param name="routeValues">The route data to use for generating the URL.</param>
644-
/// <param name="fragment">The fragment to add to the URL.</param>
644+
/// <param name="fragment">The fragment to add to the URL.</param>
645645
/// <returns>The created <see cref="RedirectToActionResult"/> for the response.</returns>
646646
public virtual RedirectToActionResult RedirectToActionPreserveMethod(
647647
string actionName = null,
@@ -659,7 +659,7 @@ public virtual RedirectToActionResult RedirectToActionPreserveMethod(
659659
}
660660

661661
/// <summary>
662-
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified action with
662+
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified action with
663663
/// <see cref="RedirectToActionResult.Permanent"/> set to true using the specified <paramref name="actionName"/>.
664664
/// </summary>
665665
/// <param name="actionName">The name of the action.</param>
@@ -670,8 +670,8 @@ public virtual RedirectToActionResult RedirectToActionPermanent(string actionNam
670670
}
671671

672672
/// <summary>
673-
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified action with
674-
/// <see cref="RedirectToActionResult.Permanent"/> set to true using the specified <paramref name="actionName"/>
673+
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified action with
674+
/// <see cref="RedirectToActionResult.Permanent"/> set to true using the specified <paramref name="actionName"/>
675675
/// and <paramref name="routeValues"/>.
676676
/// </summary>
677677
/// <param name="actionName">The name of the action.</param>
@@ -683,8 +683,8 @@ public virtual RedirectToActionResult RedirectToActionPermanent(string actionNam
683683
}
684684

685685
/// <summary>
686-
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified action with
687-
/// <see cref="RedirectToActionResult.Permanent"/> set to true using the specified <paramref name="actionName"/>
686+
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified action with
687+
/// <see cref="RedirectToActionResult.Permanent"/> set to true using the specified <paramref name="actionName"/>
688688
/// and <paramref name="controllerName"/>.
689689
/// </summary>
690690
/// <param name="actionName">The name of the action.</param>
@@ -696,7 +696,7 @@ public virtual RedirectToActionResult RedirectToActionPermanent(string actionNam
696696
}
697697

698698
/// <summary>
699-
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified action with
699+
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified action with
700700
/// <see cref="RedirectToActionResult.Permanent"/> set to true using the specified <paramref name="actionName"/>,
701701
/// <paramref name="controllerName"/>, and <paramref name="fragment"/>.
702702
/// </summary>
@@ -713,7 +713,7 @@ public virtual RedirectToActionResult RedirectToActionPermanent(
713713
}
714714

715715
/// <summary>
716-
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified action with
716+
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified action with
717717
/// <see cref="RedirectToActionResult.Permanent"/> set to true using the specified <paramref name="actionName"/>,
718718
/// <paramref name="controllerName"/>, and <paramref name="routeValues"/>.
719719
/// </summary>
@@ -730,7 +730,7 @@ public virtual RedirectToActionResult RedirectToActionPermanent(
730730
}
731731

732732
/// <summary>
733-
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified action with
733+
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified action with
734734
/// <see cref="RedirectToActionResult.Permanent"/> set to true using the specified <paramref name="actionName"/>,
735735
/// <paramref name="controllerName"/>, <paramref name="routeValues"/>, and <paramref name="fragment"/>.
736736
/// </summary>
@@ -754,16 +754,16 @@ public virtual RedirectToActionResult RedirectToActionPermanent(
754754
}
755755

756756
/// <summary>
757-
/// Redirects (<see cref="StatusCodes.Status308PermanentRedirect"/>) to the specified action with
757+
/// Redirects (<see cref="StatusCodes.Status308PermanentRedirect"/>) to the specified action with
758758
/// <see cref="RedirectToActionResult.Permanent"/> set to true and <see cref="RedirectToActionResult.PreserveMethod"/>
759-
/// set to true, using the specified <paramref name="actionName"/>, <paramref name="controllerName"/>,
759+
/// set to true, using the specified <paramref name="actionName"/>, <paramref name="controllerName"/>,
760760
/// <paramref name="routeValues"/>, and <paramref name="fragment"/>.
761761
/// </summary>
762762
/// <param name="actionName">The name of the action.</param>
763763
/// <param name="controllerName">The name of the controller.</param>
764764
/// <param name="routeValues">The route data to use for generating the URL.</param>
765765
/// <param name="fragment">The fragment to add to the URL.</param>
766-
/// <returns>The created <see cref="RedirectToActionResult"/> for the response.</returns>
766+
/// <returns>The created <see cref="RedirectToActionResult"/> for the response.</returns>
767767
public virtual RedirectToActionResult RedirectToActionPermanentPreserveMethod(
768768
string actionName = null,
769769
string controllerName = null,
@@ -840,14 +840,14 @@ public virtual RedirectToRouteResult RedirectToRoute(
840840
}
841841

842842
/// <summary>
843-
/// Redirects (<see cref="StatusCodes.Status307TemporaryRedirect"/>) to the specified route with
843+
/// Redirects (<see cref="StatusCodes.Status307TemporaryRedirect"/>) to the specified route with
844844
/// <see cref="RedirectToRouteResult.Permanent"/> set to false and <see cref="RedirectToRouteResult.PreserveMethod"/>
845845
/// set to true, using the specified <paramref name="routeName"/>, <paramref name="routeValues"/>, and <paramref name="fragment"/>.
846846
/// </summary>
847847
/// <param name="routeName">The name of the route.</param>
848848
/// <param name="routeValues">The route data to use for generating the URL.</param>
849849
/// <param name="fragment">The fragment to add to the URL.</param>
850-
/// <returns>The created <see cref="RedirectToRouteResult"/> for the response.</returns>
850+
/// <returns>The created <see cref="RedirectToRouteResult"/> for the response.</returns>
851851
public virtual RedirectToRouteResult RedirectToRoutePreserveMethod(
852852
string routeName = null,
853853
object routeValues = null,
@@ -862,7 +862,7 @@ public virtual RedirectToRouteResult RedirectToRoutePreserveMethod(
862862
}
863863

864864
/// <summary>
865-
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified route with
865+
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified route with
866866
/// <see cref="RedirectToRouteResult.Permanent"/> set to true using the specified <paramref name="routeName"/>.
867867
/// </summary>
868868
/// <param name="routeName">The name of the route.</param>
@@ -873,7 +873,7 @@ public virtual RedirectToRouteResult RedirectToRoutePermanent(string routeName)
873873
}
874874

875875
/// <summary>
876-
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified route with
876+
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified route with
877877
/// <see cref="RedirectToRouteResult.Permanent"/> set to true using the specified <paramref name="routeValues"/>.
878878
/// </summary>
879879
/// <param name="routeValues">The parameters for a route.</param>
@@ -897,7 +897,7 @@ public virtual RedirectToRouteResult RedirectToRoutePermanent(string routeName,
897897
}
898898

899899
/// <summary>
900-
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified route with
900+
/// Redirects (<see cref="StatusCodes.Status301MovedPermanently"/>) to the specified route with
901901
/// <see cref="RedirectToRouteResult.Permanent"/> set to true using the specified <paramref name="routeName"/>
902902
/// and <paramref name="fragment"/>.
903903
/// </summary>
@@ -932,7 +932,7 @@ public virtual RedirectToRouteResult RedirectToRoutePermanent(
932932
/// <param name="routeName">The name of the route.</param>
933933
/// <param name="routeValues">The route data to use for generating the URL.</param>
934934
/// <param name="fragment">The fragment to add to the URL.</param>
935-
/// <returns>The created <see cref="RedirectToRouteResult"/> for the response.</returns>
935+
/// <returns>The created <see cref="RedirectToRouteResult"/> for the response.</returns>
936936
public virtual RedirectToRouteResult RedirectToRoutePermanentPreserveMethod(
937937
string routeName = null,
938938
object routeValues = null,
@@ -1075,15 +1075,15 @@ public virtual RedirectToPageResult RedirectToPagePermanent(string pageName, str
10751075
=> new RedirectToPageResult(pageName, pageHandler, routeValues, permanent: true, fragment: fragment);
10761076

10771077
/// <summary>
1078-
/// Redirects (<see cref="StatusCodes.Status307TemporaryRedirect"/>) to the specified page with
1078+
/// Redirects (<see cref="StatusCodes.Status307TemporaryRedirect"/>) to the specified page with
10791079
/// <see cref="RedirectToRouteResult.Permanent"/> set to false and <see cref="RedirectToRouteResult.PreserveMethod"/>
10801080
/// set to true, using the specified <paramref name="pageName"/>, <paramref name="routeValues"/>, and <paramref name="fragment"/>.
10811081
/// </summary>
10821082
/// <param name="pageName">The name of the page.</param>
10831083
/// <param name="pageHandler">The page handler to redirect to.</param>
10841084
/// <param name="routeValues">The route data to use for generating the URL.</param>
10851085
/// <param name="fragment">The fragment to add to the URL.</param>
1086-
/// <returns>The created <see cref="RedirectToRouteResult"/> for the response.</returns>
1086+
/// <returns>The created <see cref="RedirectToRouteResult"/> for the response.</returns>
10871087
public virtual RedirectToPageResult RedirectToPagePreserveMethod(
10881088
string pageName = null,
10891089
string pageHandler = null,
@@ -1108,7 +1108,7 @@ public virtual RedirectToPageResult RedirectToPagePreserveMethod(
11081108
/// <param name="pageHandler">The page handler to redirect to.</param>
11091109
/// <param name="routeValues">The route data to use for generating the URL.</param>
11101110
/// <param name="fragment">The fragment to add to the URL.</param>
1111-
/// <returns>The created <see cref="RedirectToRouteResult"/> for the response.</returns>
1111+
/// <returns>The created <see cref="RedirectToRouteResult"/> for the response.</returns>
11121112
public virtual RedirectToPageResult RedirectToPagePermanentPreserveMethod(
11131113
string pageName = null,
11141114
string pageHandler = null,
@@ -1207,6 +1207,8 @@ public virtual PartialViewResult Partial(string viewName)
12071207
/// <returns>The created <see cref="PartialViewResult"/> object for the response.</returns>
12081208
public virtual PartialViewResult Partial(string viewName, object model)
12091209
{
1210+
// ViewContext.ViewData is an instance of ViewDataDictionary<MyPageModel>, but we need an instance
1211+
// of ViewDataDictionary<MyPartialViewModel>.
12101212
var viewData = new ViewDataDictionary(MetadataProvider, ViewContext.ViewData.ModelState)
12111213
{
12121214
Model = model,

0 commit comments

Comments
 (0)