From fe500f2b8310759639002d53478620b260ee06ad Mon Sep 17 00:00:00 2001 From: Saba Bestaev Date: Tue, 2 Apr 2024 15:04:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D1=8B=20=D0=BA=D0=BE=D0=BD=D1=82=D1=80=D0=BE?= =?UTF-8?q?=D0=BB=D0=BB=D0=B5=D1=80=20=D0=B8=20=D1=80=D0=B5=D0=B0=D0=BB?= =?UTF-8?q?=D0=B8=D0=B7=D0=BE=D0=B2=D0=B0=D0=BB=20=D0=BC=D0=B5=D1=82=D0=BE?= =?UTF-8?q?=D0=B4=20Hello?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/HelloController.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 WebApplicationLesson1/Controllers/HelloController.cs diff --git a/WebApplicationLesson1/Controllers/HelloController.cs b/WebApplicationLesson1/Controllers/HelloController.cs new file mode 100644 index 0000000..d711236 --- /dev/null +++ b/WebApplicationLesson1/Controllers/HelloController.cs @@ -0,0 +1,20 @@ +using System; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace WebApplicationLesson1.Controllers +{ + public class HelloController : Controller + { + public string Hello() + { + int currentHour = DateTime.Now.Hour; + if (currentHour < 6) return "Доброй ночи!"; + else if (currentHour < 12) return "Доброе утро!"; + else if (currentHour < 18) return "Добрый день!"; + else return "Добрый вечер!"; + } + } +}