예제 #1
0
        public async Task<string> Post(ScoreEntry value)
        {
            if (value != null)
            {
                database.Add(value);
                await database.SaveChangesAsync();

                return "Success";
            }
            else
            {
                return "Failed";
            }
        }
예제 #2
0
        public async Task<IActionResult> Submit(ScoreEntry entry)
        {
            // Check if the result is valid
            if (!ModelState.IsValid)
            {
                return View(entry);
            }

            // Save the entry asynchronously
            database.Add(entry);
            await database.SaveChangesAsync();

            // Redirect to the Entry Action with an Anonymous Parameter that Entry() needs
            return RedirectToAction("Index");
        }
예제 #3
0
 public void Add(ScoreEntry entry)
 {
     Entries.Add(entry);
     updateOrderedList();
 }
예제 #4
0
 public void Add(ScoreEntry entry)
 {
     Entries.Add(entry);
     updateOrderedList();
 }