├── OrderAppWithRazorPages ├── wwwroot │ ├── js │ │ ├── site.min.js │ │ └── site.js │ ├── favicon.ico │ ├── lib │ │ ├── bootstrap │ │ │ ├── dist │ │ │ │ ├── fonts │ │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ │ ├── js │ │ │ │ │ └── npm.js │ │ │ │ └── css │ │ │ │ │ ├── bootstrap-theme.min.css.map │ │ │ │ │ └── bootstrap-theme.css │ │ │ ├── .bower.json │ │ │ └── LICENSE │ │ ├── jquery │ │ │ ├── .bower.json │ │ │ └── LICENSE.txt │ │ ├── jquery-validation │ │ │ ├── .bower.json │ │ │ ├── LICENSE.md │ │ │ └── dist │ │ │ │ └── additional-methods.js │ │ └── jquery-validation-unobtrusive │ │ │ ├── .bower.json │ │ │ ├── jquery.validate.unobtrusive.min.js │ │ │ └── jquery.validate.unobtrusive.js │ ├── css │ │ ├── site.min.css │ │ └── site.css │ └── images │ │ ├── banner2.svg │ │ ├── banner1.svg │ │ ├── banner3.svg │ │ └── banner4.svg ├── .bowerrc ├── Pages │ ├── _ViewStart.cshtml │ ├── _ViewImports.cshtml │ ├── About.cshtml │ ├── Contact.cshtml.cs │ ├── About.cshtml.cs │ ├── Error.cshtml.cs │ ├── Contact.cshtml │ ├── Error.cshtml │ ├── _ValidationScriptsPartial.cshtml │ ├── Index.cshtml.cs │ ├── _Layout.cshtml │ └── Index.cshtml ├── appsettings.json ├── appsettings.Development.json ├── Models │ ├── Product.cs │ └── Order.cs ├── bower.json ├── Services │ ├── IOrdersService.cs │ └── OrdersService.cs ├── OrderApp.csproj ├── Program.cs ├── bundleconfig.json ├── Properties │ └── launchSettings.json └── Startup.cs ├── order-app-screenshot.png ├── README.md ├── LICENSE ├── OrderAppWithRazorPages.sln ├── .gitattributes └── .gitignore /OrderAppWithRazorPages/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /OrderAppWithRazorPages/.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "wwwroot/lib" 3 | } 4 | -------------------------------------------------------------------------------- /OrderAppWithRazorPages/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Write your Javascript code. 2 | -------------------------------------------------------------------------------- /OrderAppWithRazorPages/Pages/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /order-app-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jongalloway/OrderAppWithRazorPages/HEAD/order-app-screenshot.png -------------------------------------------------------------------------------- /OrderAppWithRazorPages/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using OrderApp 2 | @namespace OrderApp.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /OrderAppWithRazorPages/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jongalloway/OrderAppWithRazorPages/HEAD/OrderAppWithRazorPages/wwwroot/favicon.ico -------------------------------------------------------------------------------- /OrderAppWithRazorPages/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /OrderAppWithRazorPages/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jongalloway/OrderAppWithRazorPages/HEAD/OrderAppWithRazorPages/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /OrderAppWithRazorPages/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jongalloway/OrderAppWithRazorPages/HEAD/OrderAppWithRazorPages/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /OrderAppWithRazorPages/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jongalloway/OrderAppWithRazorPages/HEAD/OrderAppWithRazorPages/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /OrderAppWithRazorPages/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jongalloway/OrderAppWithRazorPages/HEAD/OrderAppWithRazorPages/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /OrderAppWithRazorPages/Pages/About.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model AboutModel 3 | @{ 4 | ViewData["Title"] = "About"; 5 | } 6 |
Use this area to provide additional information.
10 | -------------------------------------------------------------------------------- /OrderAppWithRazorPages/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /OrderAppWithRazorPages/Models/Product.cs: -------------------------------------------------------------------------------- 1 | namespace OrderApp.Models 2 | { 3 | public class Product 4 | { 5 | public int ProductId { get; set; } 6 | public string Name { get; set; } 7 | public decimal Price { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /OrderAppWithRazorPages/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "asp.net", 3 | "private": true, 4 | "dependencies": { 5 | "bootstrap": "3.3.7", 6 | "jquery": "2.2.0", 7 | "jquery-validation": "1.14.0", 8 | "jquery-validation-unobtrusive": "3.2.6" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /OrderAppWithRazorPages/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Razor Pages example showing a complex page model 2 | 3 | Part of what makes Razor Pages powerful is that it's easy to create and evolve a complex page model. In this case, we're showing an 4 | order status page that integrates shipping status, order details, customer information, etc. 5 | 6 |  7 | -------------------------------------------------------------------------------- /OrderAppWithRazorPages/Pages/Contact.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.RazorPages; 2 | 3 | namespace OrderApp.Pages 4 | { 5 | public class ContactModel : PageModel 6 | { 7 | public string Message { get; set; } 8 | 9 | public void OnGet() 10 | { 11 | Message = "Your contact page."; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /OrderAppWithRazorPages/Pages/About.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.RazorPages; 2 | 3 | namespace OrderApp.Pages 4 | { 5 | public class AboutModel : PageModel 6 | { 7 | public string Message { get; set; } 8 | 9 | public void OnGet() 10 | { 11 | Message = "Your application description page."; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /OrderAppWithRazorPages/Services/IOrdersService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using OrderApp.Models; 3 | 4 | namespace OrderApp.Services 5 | { 6 | public interface IOrdersService 7 | { 8 | Order GetOrder(); 9 | List<(Product product, int quantity)> GetOrderDetails(int OrderId); 10 | decimal GetOrderTotal(int OrderId); 11 | (string Message, int Step) GetShippingStatus(int OrderId); 12 | } 13 | } -------------------------------------------------------------------------------- /OrderAppWithRazorPages/OrderApp.csproj: -------------------------------------------------------------------------------- 1 |
13 | Request ID: @Model.RequestId
14 |
19 | Swapping to Development environment will display more detailed information about the error that occurred. 20 |
21 |22 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. 23 |
24 | -------------------------------------------------------------------------------- /OrderAppWithRazorPages/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Wrapping element */ 7 | /* Set some basic padding to keep content from hitting the edges */ 8 | .body-content { 9 | padding-left: 15px; 10 | padding-right: 15px; 11 | } 12 | 13 | 14 | /* Based on http://prepbootstrap.com/bootstrap-template/steps-navigation-progressbar */ 15 | .progress { 16 | padding: 0; 17 | margin-bottom: 0; 18 | } 19 | 20 | .step { 21 | text-align: center; 22 | } 23 | 24 | .step .col-md-2 { 25 | background-color: #fff; 26 | border: 1px solid #C0C0C0; 27 | } 28 | 29 | .step .complete { 30 | color: #C0C0C0; 31 | border: 2px solid #C0C0C0; 32 | vertical-align: central; 33 | } 34 | 35 | 36 | .step .active { 37 | color: #F58723; 38 | border: 2px solid #5CB85C; 39 | vertical-align: central; 40 | } 41 | 42 | .step .glyphicon { 43 | padding-top: 15px; 44 | font-size: 40px; 45 | } -------------------------------------------------------------------------------- /OrderAppWithRazorPages/wwwroot/lib/jquery-validation/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation", 3 | "homepage": "http://jqueryvalidation.org/", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/jzaefferer/jquery-validation.git" 7 | }, 8 | "authors": [ 9 | "Jörn ZaeffererOrdered
38 |Order Filled
42 |Shipped
46 |Out for Delivery
50 |Delivered
54 |65 | Your order has been placed under the terms of your corporate agreement. 66 | Use these items in accordance with all city, state, national, 67 | and galactic laws. Caveat emptor. 68 |
69 || Product | 74 |Quantity | 75 |Unit Price | 76 |Subtotal | 77 |
|---|---|---|---|
| @order.product.Name | 83 |@order.quantity | 84 |@order.product.Price | 85 |@(order.product.Price * order.quantity) | 86 |
| 90 | | 91 | | 92 | | @Model.Total | 93 |