Ejemplo n.º 1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            RateList = await _context.RateList.SingleOrDefaultAsync(m => m.ID == id);//detail by id

            if (RateList == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

            if (RateList != null)
            {
                _context.RateList.Remove(RateList);//delete ratelist
                await _context.SaveChangesAsync();
            }

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