public IActionResult Index(IndexModel model) { Intern intern = _mapper.Map <Intern>(model); intern.DateCreated = DateTime.Now; intern.CreatedBy = User.Claims.ElementAt(1).Value; try { _adapter.CreateIntern(intern); } catch (AppException) { Response.StatusCode = -1; } model = new IndexModel(_adapter.GetInterns()); ShiftTopMenuData(); return(View(model)); }