Beispiel #1
0
        public async Task <bool> DeleteHeroAsync(DeleteHeroRequest request)
        {
            var hero = await GetHeroAsync(request.Id);

            if (hero == null)
            {
                return(false);
            }

            _context.Remove(hero);

            return(await _context.SaveChangesAsync() > 0);
        }
 public void Delete <T>(T Entity) where T : class
 {
     _context.Remove(Entity);
 }
 public void Remove <T>(T entity) where T : class
 {
     _heroContext.Remove(entity);
 }