Example #1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ZalozeniaDlaOferty = await _context.ZolozeniaDlaOferty.FirstOrDefaultAsync(m => m.Id == id);

            if (ZalozeniaDlaOferty == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Example #2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ZalozeniaDlaOferty = await _context.ZolozeniaDlaOferty.FindAsync(id);

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

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