public RandomNumber(NewRandomNumbersViewModel newRandomNumbers) { Ascending = newRandomNumbers.IsAscending(); Stopwatch stopwatch = Stopwatch.StartNew(); SortedNumbers = SortNumbers(newRandomNumbers.UnsortedNumbers); //int will be large enough for this. Millis = (int)stopwatch.ElapsedMilliseconds; }
public ActionResult Create(NewRandomNumbersViewModel viewModel) { _context.RandomNumbers.Add(new RandomNumber(viewModel)); _context.SaveChanges(); return(RedirectToAction("Index", "RandomNumbers")); }