Example #1
0
        public async Task DeleteSuperHeroAsync(int id)
        {
            var hero = new SuperHero {
                Id = id
            };

            _context.Attach(hero);
            _context.Remove(hero);
            await _context.SaveChangesAsync();
        }
Example #2
0
        public async Task DeleteSuperPowerAsync(int id)
        {
            var superpower = new SuperPower {
                Id = id
            };

            _context.Attach(superpower);
            _context.Remove(superpower);
            await _context.SaveChangesAsync();
        }