public async Task <IActionResult> Create(ProductDescriptionCreateEditViewModel vm)
        {
            if (ModelState.IsValid)
            {
                var bllEntity = _mapper.Map(vm);
                _bll.ProductDescriptions.Add(bllEntity);
                await _bll.SaveChangesAsync();

                vm.Id = bllEntity.Id;
                return(RedirectToAction(nameof(Index)));
            }
            return(View(vm));
        }
        public async Task <IActionResult> Edit(Guid id, ProductDescriptionCreateEditViewModel vm)
        {
            if (id != vm.Id)
            {
                return(BadRequest(new MessageDTO("Id and productDescriptionEditDTO.id do not match")));
            }

            if (!await _bll.ProductDescriptions.ExistsAsync(vm.Id))
            {
                return(NotFound(new MessageDTO($"Product description with this id {id} not found")));
            }

            if (ModelState.IsValid)
            {
                await _bll.ProductDescriptions.UpdateAsync(_mapper.Map(vm));

                await _bll.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(vm));
        }
        // GET: ProductDescriptions/Create
        public IActionResult Create()
        {
            var vm = new ProductDescriptionCreateEditViewModel();

            return(View(vm));
        }