Пример #1
0
        public async Task <IActionResult> SliderEdit(int id, [Bind("sliderFotoId,fotoUrl,fotoBaslik,fotoAciklama")] SliderFoto sliderFoto)
        {
            if (id != sliderFoto.sliderFotoId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(sliderFoto);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SliderFotoExists(sliderFoto.sliderFotoId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Admin)));
            }
            return(View(sliderFoto));
        }
Пример #2
0
        public async Task <IActionResult> SliderCreate([Bind("sliderFotoId,fotoUrl,fotoBaslik,fotoAciklama")] SliderFoto sliderFoto)
        {
            if (ModelState.IsValid)
            {
                _context.Add(sliderFoto);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Admin)));
            }
            return(View(sliderFoto));
        }