using Mvc4withKnockoutJsWalkThrough.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Mvc4withKnockoutJsWalkThrough.Controllers
{
    public class PersonController : Controller
    {
        public ActionResult Index()
        {
            var viewModel = new PersonViewModel()
            {
                Id = 1,
                Name = "Naveen",
                DateOfBirth = new DateTime(1990, 11, 21)
            };

            return View(viewModel);
        }

        [HttpPost]
        public JsonResult SavePersonDetails(PersonViewModel viewModel)
        {
            // TODO: Save logic goes here.

            return Json(new { });
        }
    }
}
