コード例 #1
0
        public async Task <IActionResult> Edit(int id, Partitura partitura)
        {
            if (id != partitura.Id)
            {
                return(NotFound());
            }
            await _svc.update(id, partitura);

            return(Ok());
        }
コード例 #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Title,ReleaseDate,Genre,Time,Price")] Partitura partitura)
        {
            if (id != partitura.Id)
            {
                return(NotFound());
            }

            if (!ModelState.IsValid)
            {
                return(View(partitura));
            }

            await _svc.update(id, partitura);

            return(RedirectToAction(nameof(Index)));
        }