/// <returns>A task that represents the asynchronous operation</returns> public async Task <IActionResult> DeleteSystemTaxCodes() { //ensure that Avalara tax provider is active if (!await _taxPluginManager.IsPluginActiveAsync(AvalaraTaxDefaults.SystemName)) { return(await Categories()); } if (!await _permissionService.AuthorizeAsync(StandardPermissionProvider.ManageTaxSettings)) { return(AccessDeniedView()); } var deleted = await _avalaraTaxManager.DeleteSystemTaxCodesAsync(); if (deleted) { _notificationService.SuccessNotification(await _localizationService.GetResourceAsync("Plugins.Tax.Avalara.TaxCodes.Delete.Success")); } else { _notificationService.ErrorNotification(await _localizationService.GetResourceAsync("Plugins.Tax.Avalara.TaxCodes.Delete.Error")); } return(await Categories()); }