Ejemplo n.º 1
0
        /// <summary>
        /// Deletes an entity of type T from the database.
        /// </summary>
        public void Delete(T entity)
        {
            _semaphore.Wait();

            try
            {
                _context.Remove(entity);
                _context.SaveChanges();
            }
            finally
            {
                _semaphore.Release();
            }
        }
Ejemplo n.º 2
0
 public Character Remove(Character write)
 {
     if (write != null)
     {
         _db.Remove(write);
         _db.SaveChanges();
     }
     return(write);
 }
Ejemplo n.º 3
0
 public Job Remove(Job write)
 {
     if (write != null)
     {
         _db.Remove(write);
         _db.SaveChanges();
     }
     return(write);
 }
Ejemplo n.º 4
0
 public Weapon Remove(Weapon write)
 {
     if (write != null)
     {
         _db.Remove(write);
         _db.SaveChanges();
     }
     return(write);
 }
Ejemplo n.º 5
0
 public Skill Remove(Skill write)
 {
     if (write != null)
     {
         _db.Remove(write);
         _db.SaveChanges();
     }
     return(write);
 }
Ejemplo n.º 6
0
        public async Task DeleteEffectAsync(Effect effect)
        {
            // If it doesn't exist in the DB, abort
            if (await _context.Effects.CountAsync(c => c.Id.Equals(effect.Id)) <= 0)
            {
                return;
            }

            var dto = await _context.Effects.FirstOrDefaultAsync(x => x.Id.Equals(effect.Id));

            _context.Remove(dto);

            await _context.SaveChangesAsync();
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Deletes an entity of type T from the database.
 /// </summary>
 public void Delete(T entity)
 {
     _context.Remove(entity);
     _context.SaveChanges();
 }
Ejemplo n.º 8
0
 public async Task DeleteStatisticAsync(Statistic statistic)
 {
     _context.Remove(statistic);
     await _context.SaveChangesAsync();
 }