// // GET: /Cards/ public ActionResult Index() { if (User.Identity.IsAuthenticated) { List <Tasks> tasks = TasksDAL.GetTasksByUser(User.Identity.Name); List <TaskViewModel> tasksViewModel = new List <TaskViewModel>(); foreach (var task in tasks) { tasksViewModel.Add( new TaskViewModel(task) ); } return(View(tasksViewModel)); } return(RedirectToAction("Index", "Home")); }