public IActionResult Index() { int id = Convert.ToInt32(User.Claims.Where(c => c.Type == "Id") .Select(c => c.Value).SingleOrDefault()); var goalList = logic.GetAllByUserId(id); var model = new UserGoalsViewModel(); model.Goals = goalList; return(View(model)); }
public IActionResult UserGoals(int UserId) { var uLogic = new UserLogic(); User user = uLogic.GetSingle(UserId); List <Goal> goals = logic.GetAllByUserId(UserId); var model = new UserGoalsViewModel() { Username = user.Username, Goals = goals }; return(View(model)); }