-
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
10 changed files
with
79 additions
and
0 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,10 @@ | ||
namespace OdeToFoodRider.Models | ||
{ | ||
public enum CuisineType | ||
{ | ||
None, | ||
Italian, | ||
French, | ||
German | ||
} | ||
} |
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,23 @@ | ||
@using OdeToFoodRider.Models | ||
@model OdeToFoodRider.Models.Restaurant | ||
|
||
<!DOCTYPE html> | ||
|
||
<html> | ||
<head> | ||
<title>Add a Restaurant</title> | ||
</head> | ||
<body> | ||
<h1>Create</h1> | ||
|
||
<input asp-for="Name"/> | ||
|
||
@*VSRD: Rider's code analysis bug in the asp-items expression below: RSRP-469518 *@ | ||
<select asp-for="Cuisine" asp-items="@Html.GetEnumSelectList<CuisineType>()"></select> | ||
|
||
<input type="submit" name="save" value="Save"/> | ||
<div> | ||
|
||
</div> | ||
</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 |
---|---|---|
|
@@ -27,5 +27,7 @@ | |
} | ||
</table> | ||
|
||
<a asp-action="Create">Add Restaurant</a> | ||
|
||
</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
15 changes: 15 additions & 0 deletions
15
OdeToFoodVisualStudio/OdeToFoodVisualStudio/Models/CuisineType.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,15 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace OdeToFoodVisualStudio.Models | ||
{ | ||
public enum CuisineType | ||
{ | ||
None, | ||
Italian, | ||
French, | ||
German | ||
} | ||
} |
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
16 changes: 16 additions & 0 deletions
16
OdeToFoodVisualStudio/OdeToFoodVisualStudio/Views/Home/Create.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,16 @@ | ||
@using OdeToFoodVisualStudio.Models | ||
@model OdeToFoodVisualStudio.Models.Restaurant | ||
@* VSRD: Visual Studio gives no import suggestions for model declaration - have to type in FQN (for which there is completion) *@ | ||
|
||
<h1>Create</h1> | ||
|
||
<form method="post"> | ||
|
||
<input asp-for="Name"/> | ||
|
||
@* VSRD: No import action for unreferenced CuisineType, have to manually add a @using *@ | ||
<select asp-for="Cuisine" asp-items="@Html.GetEnumSelectList<CuisineType>()"></select> | ||
@* The above won't work if the select tag is empty (auto-closed: <select/>) *@ | ||
|
||
<input type="submit" name="save" value="Save" /> | ||
</form> |
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 |
---|---|---|
|
@@ -24,5 +24,6 @@ | |
</tr> | ||
} | ||
</table> | ||
<a asp-action="Create">Add Restaurant</a> | ||
</body> | ||
</html> |