Commit 2737922c authored by gdlcf88's avatar gdlcf88

Removed CategoryIds form ProductDto

parent f1a00bac
......@@ -10,8 +10,6 @@ namespace EasyAbp.EShop.Products.Products.Dtos
public Guid ProductTypeId { get; set; }
public ICollection<Guid> CategoryIds { get; set; }
public string DisplayName { get; set; }
public InventoryStrategy InventoryStrategy { get; set; }
......
......@@ -129,16 +129,6 @@ namespace EasyAbp.EShop.Products.Products
await base.DeleteAsync(id);
}
public override async Task<ProductDto> GetAsync(Guid id)
{
var dto = await base.GetAsync(id);
dto.CategoryIds = (await _productCategoryRepository.GetListByProductId(dto.Id, dto.StoreId))
.Select(x => x.CategoryId).ToList();
return dto;
}
protected virtual async Task UpdateProductCategoriesAsync(Guid productId, Guid storeId, IEnumerable<Guid> categoryIds)
{
await _productCategoryRepository.DeleteAsync(x => x.ProductId.Equals(productId));
......
......@@ -18,8 +18,7 @@ namespace EasyAbp.EShop.Products
/* You can configure your AutoMapper mapping configuration here.
* Alternatively, you can split your mapping configurations
* into multiple profile classes for a better organization. */
CreateMap<Product, ProductDto>()
.Ignore(dto => dto.CategoryIds);
CreateMap<Product, ProductDto>();
CreateMap<ProductDetail, ProductDetailDto>();
CreateMap<ProductAttribute, ProductAttributeDto>();
CreateMap<ProductAttributeOption, ProductAttributeOptionDto>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment