コード例 #1
0
ファイル: Delete.cshtml.cs プロジェクト: kkereziev/WebSite
        public async Task <IActionResult> OnGetAsync(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            PanthsSize = await _context.PanthsSize
                         .Include(p => p.Panths).FirstOrDefaultAsync(m => m.Id == id);

            if (PanthsSize == null)
            {
                return(NotFound());
            }
            return(Page());
        }
コード例 #2
0
ファイル: Delete.cshtml.cs プロジェクト: kkereziev/WebSite
        public async Task <IActionResult> OnPostAsync(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            PanthsSize = await _context.PanthsSize.FindAsync(id);

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

            return(RedirectToPage("./Index"));
        }
コード例 #3
0
ファイル: Edit.cshtml.cs プロジェクト: kkereziev/WebSite
        public async Task <IActionResult> OnGetAsync(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            PanthsSize = await _context.PanthsSize
                         .Include(p => p.Panths).FirstOrDefaultAsync(m => m.Id == id);

            if (PanthsSize == null)
            {
                return(NotFound());
            }
            ViewData["PanthsId"] = new SelectList(_context.Panths, "Id", "Id");
            return(Page());
        }