示例#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();
 }