Пример #1
0
        public async Task <IActionResult> Edit(string id, mbc_db_areatype mbc_dv_movie)
        {
            if (id != mbc_dv_movie.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    await _respository.UpdateAsync(mbc_dv_movie);
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (_respository.GetByIDAsync(mbc_dv_movie.ID) == null)
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(mbc_dv_movie));
        }
Пример #2
0
        public async Task <IActionResult> Create(mbc_db_areatype mbc_dv_movie)
        {
            if (ModelState.IsValid)
            {
                await _respository.InsertAsync(mbc_dv_movie);

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