/// <returns>A task that represents the asynchronous operation</returns>
        public virtual async Task <IActionResult> Delete(int id)
        {
            if (!await _permissionService.AuthorizeAsync(StandardPermissionProvider.ManageSettings))
            {
                return(AccessDeniedView());
            }

            //try to get a vendor attribute with the specified id
            var vendorAttribute = await _vendorAttributeService.GetVendorAttributeByIdAsync(id);

            if (vendorAttribute == null)
            {
                return(RedirectToAction("List"));
            }

            await _vendorAttributeService.DeleteVendorAttributeAsync(vendorAttribute);

            //activity log
            await _customerActivityService.InsertActivityAsync("DeleteVendorAttribute",
                                                               string.Format(await _localizationService.GetResourceAsync("ActivityLog.DeleteVendorAttribute"), vendorAttribute.Id), vendorAttribute);

            _notificationService.SuccessNotification(await _localizationService.GetResourceAsync("Admin.Vendors.VendorAttributes.Deleted"));

            return(RedirectToAction("List"));
        }