+ Request ID: @Model.RequestId
+
+ Swapping to the Development environment displays detailed information about the error that occurred. +
++ The Development environment shouldn't be enabled for deployed applications. + It can result in displaying sensitive information from exceptions to end users. + For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development + and restarting the app. +
diff --git a/aspnetcore/data/ef-rp/intro/samples/cu90/Pages/Error.cshtml.cs b/aspnetcore/data/ef-rp/intro/samples/cu90/Pages/Error.cshtml.cs new file mode 100644 index 000000000000..774b28a1321b --- /dev/null +++ b/aspnetcore/data/ef-rp/intro/samples/cu90/Pages/Error.cshtml.cs @@ -0,0 +1,27 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; +using System.Diagnostics; + +namespace ContosoUniversity.Pages +{ + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] + [IgnoreAntiforgeryToken] + public class ErrorModel : PageModel + { + public string RequestId { get; set; } + + public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + + private readonly ILogger+ Contoso University is a sample application that + demonstrates how to use Entity Framework Core in an + ASP.NET Core Razor Pages web app. +
++ You can build the application by following the steps in a series of tutorials. +
++@* See the tutorial +*@
++ You can download the completed project from GitHub. +
++@* See project source code +*@
+Use this page to detail your site's privacy policy.
diff --git a/aspnetcore/data/ef-rp/intro/samples/cu90/Pages/Privacy.cshtml.cs b/aspnetcore/data/ef-rp/intro/samples/cu90/Pages/Privacy.cshtml.cs new file mode 100644 index 000000000000..1451277e7633 --- /dev/null +++ b/aspnetcore/data/ef-rp/intro/samples/cu90/Pages/Privacy.cshtml.cs @@ -0,0 +1,19 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace ContosoUniversity.Pages +{ + public class PrivacyModel : PageModel + { + private readonly ILogger+ Create New +
+| + @Html.DisplayNameFor(model => model.Student[0].LastName) + | ++ @Html.DisplayNameFor(model => model.Student[0].FirstMidName) + | ++ @Html.DisplayNameFor(model => model.Student[0].EnrollmentDate) + | ++ |
|---|---|---|---|
| + @Html.DisplayFor(modelItem => item.LastName) + | ++ @Html.DisplayFor(modelItem => item.FirstMidName) + | ++ @Html.DisplayFor(modelItem => item.EnrollmentDate) + | ++ Edit | + Details | + Delete + | +