示例#1
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(ArticleSource).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ArticleSourceExists(ArticleSource.Id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
示例#2
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.VideoSources.Add(VideoSource);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
示例#3
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ArticleSource = await _context.ArticleSources.FindAsync(id);

            if (ArticleSource != null)
            {
                _context.ArticleSources.Remove(ArticleSource);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
示例#4
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            TvProgram = await _context.TvPrograms.FindAsync(id);

            if (TvProgram != null)
            {
                _context.TvPrograms.Remove(TvProgram);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
示例#5
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            DefaultSchedule = await _context.DefaultSchedules.FindAsync(id);

            if (DefaultSchedule != null)
            {
                _context.DefaultSchedules.Remove(DefaultSchedule);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
示例#6
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Corner = await _context.Corners.FindAsync(id);

            if (Corner != null)
            {
                _context.Corners.Remove(Corner);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }