public async Task <ActionResult> CalcBmi(DashboardViewmodel viewmodel) { var userEmail = HttpContext.User.Claims.Where(i => i.Type == ClaimTypes.Email).First().Value; var _user = logic.GetUserByEmail(userEmail); var _viewmodel = new DashboardViewmodel { User = _user, Weight = logic.GetWeightById(_user.Id), Height = logic.GetHeightById(_user.Id) }; var bmi = logic.CalcBmi(_viewmodel.Weight, _viewmodel.Height, _user.Id); return(RedirectToAction("index", "Dashboard")); }