public async Task <ProductCategoryForEditOutput> GetProductCategoryForEdit(NullableIdDto input)
        {
            ProductCategoryCreateOrEditDto productCategoryEditDto;

            if (input.Id.HasValue) //Editing existing edition?
            {
                ProductCategory productCategory = await Repository.GetAsync(input.Id.Value);

                productCategoryEditDto = productCategory.MapTo <ProductCategoryCreateOrEditDto>();
            }
            else
            {
                productCategoryEditDto = new ProductCategoryCreateOrEditDto();
            }

            return(new ProductCategoryForEditOutput
            {
                ProductCategory = productCategoryEditDto
            });
        }
        public ProductCategoryDto CreateOrUpdateProductCategory(ProductCategoryCreateOrEditDto input)
        {
            if (!input.Id.HasValue)
            {
                CheckCreatePermission();

                var entity = input.MapTo <ProductCategory>();

                Repository.Insert(entity);
                CurrentUnitOfWork.SaveChanges();

                return(MapToEntityDto(entity));
            }
            else
            {
                CheckUpdatePermission();

                var entity = GetEntityById(input.Id.Value);
                ObjectMapper.Map(input, entity);
                CurrentUnitOfWork.SaveChanges();

                return(MapToEntityDto(entity));
            }
        }