/// <returns>A task that represents the asynchronous operation</returns>
        public virtual async Task <IActionResult> Create(VendorAttributeModel model, bool continueEditing)
        {
            if (!await _permissionService.AuthorizeAsync(StandardPermissionProvider.ManageSettings))
            {
                return(AccessDeniedView());
            }

            if (ModelState.IsValid)
            {
                var vendorAttribute = model.ToEntity <VendorAttribute>();
                await _vendorAttributeService.InsertVendorAttributeAsync(vendorAttribute);

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

                //locales
                await UpdateAttributeLocalesAsync(vendorAttribute, model);

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

                if (!continueEditing)
                {
                    return(RedirectToAction("List"));
                }

                return(RedirectToAction("Edit", new { id = vendorAttribute.Id }));
            }

            //prepare model
            model = await _vendorAttributeModelFactory.PrepareVendorAttributeModelAsync(model, null, true);

            //if we got this far, something failed, redisplay form
            return(View(model));
        }