コード例 #1
0
        /// <returns>A task that represents the asynchronous operation</returns>
        public virtual async Task <IActionResult> ValueList(VendorAttributeValueSearchModel searchModel)
        {
            if (!await _permissionService.AuthorizeAsync(StandardPermissionProvider.ManageSettings))
            {
                return(await AccessDeniedDataTablesJson());
            }

            //try to get a vendor attribute with the specified id
            var vendorAttribute = await _vendorAttributeService.GetVendorAttributeByIdAsync(searchModel.VendorAttributeId)
                                  ?? throw new ArgumentException("No vendor attribute found with the specified id");

            //prepare model
            var model = await _vendorAttributeModelFactory.PrepareVendorAttributeValueListModelAsync(searchModel, vendorAttribute);

            return(Json(model));
        }