public async Task <IHttpActionResult> Post(CreateCustomerProductSuggestionCommand command)
        {
            command.UserId = UserId;
            var commandResponse = await Bus.Send <CreateCustomerProductSuggestionCommand, CreateCustomerProductSuggestionCommandResponse>(command);

            var response = new ResponseModel
            {
                Message      = "ثبت کالای پیشنهادی با موفقیت انجام شد",
                Success      = true,
                ResponseData = commandResponse
            };

            return(Ok(response));
        }
        public async Task <CreateCustomerProductSuggestionCommandResponse> Handle(CreateCustomerProductSuggestionCommand command)
        {
            var person = await _personRepository.AsQuery().OfType <Customer>().SingleOrDefaultAsync(p => p.UserId == command.UserId);

            if (person == null)
            {
                throw new DomainException("شخص یافت نشد");
            }
            var categoryRoot = await _categoryRootRepository.FindAsync(command.CategoryRootId);

            if (categoryRoot == null)
            {
                throw new DomainException("دسته بندی ریشه یافت نشد");
            }
            Guid   categoryId   = Guid.Empty;
            string categoryName = "";
            var    category     = await _categoryRepository.FindAsync(command.CategoryId);

            if (category != null)
            {
                categoryId   = category.Id;
                categoryName = category.Name;
            }
            Guid   brandId   = Guid.Empty;
            string brandName = "";
            var    brand     = await _brandRepository.FindAsync(command.BrandId);

            if (brand != null)
            {
                brandName = brand.Name;
                brandId   = brand.Id;
            }
            var productSuggestionGroup = new ProductSuggestionGroup(categoryRoot.Id, categoryRoot.Name,
                                                                    categoryId, categoryName, brandId, brandName);
            var productSuggestion = new CustomerProductSuggestion(Guid.NewGuid(), command.Title, command.ProductImage,
                                                                  command.Description, person.Id, productSuggestionGroup);

            _repository.Add(productSuggestion);
            return(new CreateCustomerProductSuggestionCommandResponse());
        }