Пример #1
0
 public void DeleteCommand(Command cmd)
 {
     if (cmd == null)
     {
         throw new ArgumentNullException(nameof(cmd));
     }
     _context.Remove <Command>(cmd);
 }
Пример #2
0
 public void DeleteCommand(Command command)
 {
     if (command == null)
     {
         throw new ArgumentNullException(nameof(command));
     }
     _commanderContext.Remove(command);
 }
Пример #3
0
 public void DeleteCommand(Command cmd)
 {
     if (cmd == null)
     {
         throw new NullReferenceException();
     }
     else
     {
         _dbContext.Remove(cmd);
     }
 }
Пример #4
0
        /// <summary>
        /// Deletes
        /// </summary>
        /// <param name="id"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public async Task DeleteCommand(int id, CancellationToken cancellationToken)
        {
            var command = await GetCommandById(id, cancellationToken).ConfigureAwait(false);

            if (command == null)
            {
                throw new ArgumentNullException();
            }

            _context.Remove(command);
            _ = await SaveChanges(cancellationToken);
        }
Пример #5
0
 public void DeleteCommand(Command cmd)
 {
     _context.Remove(cmd);
 }