/// <summary> /// gets all sudokus and their creation date and stores them in an IDictionary which is a list of integers and DateTimes /// and returns the IDictionary /// </summary> /// <returns></returns> private SudokuListView GetListViewModel() { string userID = User.Identity.Name; SudokuListView List = new SudokuListView(); SudoCRUD s = new SudoCRUD(); IDictionary <int, DateTime> DBList = s.SudokuList(); foreach (var item in DBList) { SudokuModel temp = new SudokuModel(); temp.ID = item.Key; temp.CreationDate = item.Value; List.AddSudoToList(temp); } return(List); }
public ActionResult Index() { SudokuListView model = GetListViewModel(); return(View(model)); }