diff --git a/src/Microsoft.AspNetCore.Mvc.RazorPages/Page.cs b/src/Microsoft.AspNetCore.Mvc.RazorPages/Page.cs
index b043ba8e18..0007c2d3e5 100644
--- a/src/Microsoft.AspNetCore.Mvc.RazorPages/Page.cs
+++ b/src/Microsoft.AspNetCore.Mvc.RazorPages/Page.cs
@@ -3,6 +3,7 @@
using System;
using System.Diagnostics;
+using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Mvc.Razor;
using Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
@@ -18,10 +19,13 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages
private PageArgumentBinder _binder;
///
- /// The .
+ /// The .
///
public PageContext PageContext { get; set; }
+ ///
+ /// Gets or sets the .
+ ///
public PageArgumentBinder Binder
{
get
@@ -45,6 +49,11 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages
}
}
+ ///
+ /// Gets the .
+ ///
+ public ModelStateDictionary ModelState => PageContext?.ModelState;
+
///
/// Gets the from the .
///
@@ -57,6 +66,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages
throw new NotSupportedException();
}
+ ///
public override void BeginContext(int position, int length, bool isLiteral)
{
const string BeginContextEvent = "Microsoft.AspNetCore.Mvc.Razor.BeginInstrumentationContext";
@@ -76,6 +86,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages
}
}
+ ///
public override void EndContext()
{
const string EndContextEvent = "Microsoft.AspNetCore.Mvc.Razor.EndInstrumentationContext";