コード例 #1
0
        public async Task <IHttpActionResult> Delete(int id)
        {
            return(await TryCatchAsync(async() =>
            {
                await _playersServices.Delete(id);

                return Ok();
            }));
        }
コード例 #2
0
        public async Task <IActionResult> Delete(int id)
        {
            var userId = GetUserId();
            var result = await _service.Delete(id, userId);

            if (!result)
            {
                return(NotFound("No player found"));
            }
            return(Ok());
        }
コード例 #3
0
 public ActionResult DeleteConfirmed(int?id)
 {
     service.Delete(id);
     return(RedirectToAction("AllPlayers"));
 }