using HelloEmpty_ToMVC.Models;
using Microsoft.AspNetCore.Mvc;

namespace HelloEmpty_ToMVC.Controllers
{
    public class HomeController : Controller
    {
        public IActionResult Index()
        {
            HelloMessage msg = new HelloMessage()
            {
                Message = "Welcome to ASP.NET MCV!"
            };

            ViewBag.Noti = "Input message and click submit";

            return View(msg);
        }

        // Post 처리용 Index
        [HttpPost]
        public IActionResult Index(HelloMessage obj)
        {
            ViewBag.Noti = "Message Changed";
            return View(obj);
        }
    }
}
