Пример #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,File")] Presentation presentation)
        {
            if (id != presentation.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    await _presentationRepository.Edit(presentation);
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PresentationExists(presentation.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(presentation));
        }
        public void Create(Presentation entity)
        {
            try
            {
                if (entity == null)
                {
                    return;
                }

                _presentationRepository.Edit(entity);
            }
            catch (Exception)
            {
                return;
            }
        }