Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.AspNetCore.Mvc;
using ToDo.Models;

namespace ToDo.Controllers
namespace ToDoApp.Controllers
{
public class HomeController : Controller
{
Expand Down
19 changes: 19 additions & 0 deletions Lesson00.5/StartOfLesson/ToDo/Controllers/ToDoController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;

// For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace ToDoApp.Controllers
{
public class ToDoController : Controller
{
// GET: /<controller>/
public IActionResult Index()
{
return View();
}
}
}
4 changes: 4 additions & 0 deletions Lesson00.5/StartOfLesson/ToDo/ToDo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.1" />
</ItemGroup>

<ItemGroup>
<Folder Include="Views\ToDo\" />
</ItemGroup>

</Project>
15 changes: 15 additions & 0 deletions Lesson00.5/StartOfLesson/ToDo/Views/Shared/_MyLayout.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

<!DOCTYPE html>

<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>View</title>
</head>
<body>
<div>
The Time is Even!!!
</div>
@RenderBody()
</body>
</html>
10 changes: 9 additions & 1 deletion Lesson00.5/StartOfLesson/ToDo/Views/_ViewStart.cshtml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
@{
Layout = "_Layout";
int minute = DateTime.Now.Minute;
if (minute % 2 == 0) //even
{
Layout = "_MyLayout";
}
else
{
Layout = "_Layout";
}
}