public ActionResult Index() { var count = _counterService.GetAll().FirstOrDefault(); if (count == null) { _counterService.Add(new Count { CountNo = 1 }); count = _counterService.GetAll().FirstOrDefault(); } return(View(ConvertToModel(count))); }