Beispiel #1
0
        public async Task <IActionResult> Create(ProductAttributeModel model)
        {
            var productAttribute = new ProductAttributeModifyRequest()
            {
                Description = model.Description,
                Name        = model.Name,
                CreatedById = LoggedUserId,
                UpdatedById = LoggedUserId
            };

            var exist = await _productAttributeService.FindByNameAsync(model.Name);

            if (exist != null)
            {
                return(RedirectToErrorPage());
            }

            var id = await _productAttributeService.CreateAsync(productAttribute);

            return(RedirectToAction(nameof(Detail), new { id }));
        }