public async Task <IActionResult> DeleteAsync(int id) { var result = await _inventoryRepository.DeleteAsync(id); return(Ok(result)); }
public async Task <IActionResult> DeleteConfirmed(string userId) { var user = await userManager.FindByIdAsync(userId); await userManager.DeleteAsync(user); await inventoryRepository.DeleteAsync(this.inventoryRepository.GetAll().FirstOrDefault(i => i.UserName == user.UserName)); return(RedirectToAction(nameof(Index))); }
public async Task <bool> DeleteTypeAsync(int typeId, CancellationToken cancellationToken = default(CancellationToken)) { var type = await GetTypeByIdAsync(typeId); var inventories = await _inventoryRepository.GetInventoryByTypeIdAsync(typeId); foreach (var inventory in inventories) { await _inventoryRepository.DeleteAsync(inventory, cancellationToken); } await _inventoryTypesRepository.DeleteAsync(type, cancellationToken); return(true); }
public async Task DeleteAsync(int inventoryId) { await _inventoryRepository.DeleteAsync(inventoryId); }