-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
104 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@page "{name}" | ||
|
||
@model GreetingModel | ||
|
||
<div>@Model.CurrentGreeting</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
using OdeToFoodRider.Services; | ||
|
||
namespace OdeToFoodRider.Pages | ||
{ | ||
public class GreetingModel : PageModel | ||
{ | ||
private readonly IGreeter _greeter; | ||
|
||
public string CurrentGreeting { get; set; } | ||
|
||
public GreetingModel(IGreeter greeter) | ||
{ | ||
_greeter = greeter; | ||
} | ||
|
||
public void OnGet(string name) | ||
{ | ||
CurrentGreeting = $"{name}: {_greeter.GetMessageOfTheDay()}"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
|
||
<html> | ||
<head> | ||
<title>@ViewBag.Title</title> | ||
</head> | ||
<body> | ||
<div> | ||
@RenderBody() | ||
</div> | ||
<footer>@RenderSection("footer", required: false)</footer> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@using OdeToFoodRider.Models | ||
@using OdeToFoodRider.ViewModels | ||
@using OdeToFoodRider.Pages; | ||
@using OdeToFoodRider.Services; | ||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@{ | ||
Layout = "_Layout.cshtml"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
OdeToFoodVisualStudio/OdeToFoodVisualStudio/Pages/Greeting.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@page "{name}" | ||
|
||
@model GreetingModel | ||
|
||
<div>@Model.CurrentGreeting</div> |
27 changes: 27 additions & 0 deletions
27
OdeToFoodVisualStudio/OdeToFoodVisualStudio/Pages/Greeting.cshtml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Mvc.RazorPages; | ||
using OdeToFoodVisualStudio.Services; | ||
|
||
namespace OdeToFoodVisualStudio.Pages | ||
{ | ||
public class GreetingModel : PageModel | ||
{ | ||
private IGreeter _greeter; | ||
|
||
public string CurrentGreeting { get; set; } | ||
|
||
public GreetingModel(IGreeter greeter) | ||
{ | ||
_greeter = greeter; | ||
} | ||
|
||
public void OnGet(string name) | ||
{ | ||
CurrentGreeting = $"{name}: {_greeter.GetMessageOfTheDay()}"; | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
OdeToFoodVisualStudio/OdeToFoodVisualStudio/Pages/_Layout.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
|
||
<html> | ||
<head> | ||
<meta name="viewport" content="width=device-width" /> | ||
<title>@ViewBag.Title</title> | ||
</head> | ||
<body> | ||
<div> | ||
@RenderBody() | ||
</div> | ||
<footer>@RenderSection("footer", required: false)</footer> | ||
</body> | ||
</html> |
5 changes: 5 additions & 0 deletions
5
OdeToFoodVisualStudio/OdeToFoodVisualStudio/Pages/_ViewImports.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@using OdeToFoodVisualStudio.Models; | ||
@using OdeToFoodVisualStudio.ViewModels; | ||
@using OdeToFoodVisualStudio.Pages; | ||
@using OdeToFoodVisualStudio.Services; | ||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers |
3 changes: 3 additions & 0 deletions
3
OdeToFoodVisualStudio/OdeToFoodVisualStudio/Pages/_ViewStart.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@{ | ||
Layout = "_Layout.cshtml"; | ||
} |