// 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(DigitalPiano).State = EntityState.Modified;

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

            return(RedirectToPage("./Index"));
        }
        // 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.AcousticGuitar.Add(AcousticGuitar);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
Example #3
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.DigitalPiano.Add(DigitalPiano);
            await _context.SaveChangesAsync();

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

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

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

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

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

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

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

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

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

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