mirror of https://github.com/EasyAbp/EShop.git
166 changed files with 7642 additions and 242 deletions
@ -1,19 +0,0 @@ |
|||
using EasyAbp.EShop.Products.Localization; |
|||
using Volo.Abp.Authorization.Permissions; |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace EasyAbp.EShop.Products.Authorization |
|||
{ |
|||
public class ProductsPermissionDefinitionProvider : PermissionDefinitionProvider |
|||
{ |
|||
public override void Define(IPermissionDefinitionContext context) |
|||
{ |
|||
//var moduleGroup = context.AddGroup(ProductsPermissions.GroupName, L("Permission:Products"));
|
|||
} |
|||
|
|||
private static LocalizableString L(string name) |
|||
{ |
|||
return LocalizableString.Create<ProductsResource>(name); |
|||
} |
|||
} |
|||
} |
|||
@ -1,14 +0,0 @@ |
|||
using Volo.Abp.Reflection; |
|||
|
|||
namespace EasyAbp.EShop.Products.Authorization |
|||
{ |
|||
public class ProductsPermissions |
|||
{ |
|||
public const string GroupName = "Products"; |
|||
|
|||
public static string[] GetAll() |
|||
{ |
|||
return ReflectionHelper.GetPublicConstantsRecursively(typeof(ProductsPermissions)); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,37 @@ |
|||
using EasyAbp.EShop.Products.Localization; |
|||
using Volo.Abp.Authorization.Permissions; |
|||
using Volo.Abp.Localization; |
|||
using Volo.Abp.MultiTenancy; |
|||
|
|||
namespace EasyAbp.EShop.Products.Authorization |
|||
{ |
|||
public class ProductsPermissionDefinitionProvider : PermissionDefinitionProvider |
|||
{ |
|||
public override void Define(IPermissionDefinitionContext context) |
|||
{ |
|||
var moduleGroup = context.AddGroup(ProductsPermissions.GroupName, L("Permission:Products")); |
|||
|
|||
var productTypes = moduleGroup.AddPermission(ProductsPermissions.ProductTypes.Default, L("Permission:ProductType"), MultiTenancySides.Host); |
|||
productTypes.AddChild(ProductsPermissions.ProductTypes.Create, L("Permission:Create"), MultiTenancySides.Host); |
|||
productTypes.AddChild(ProductsPermissions.ProductTypes.Update, L("Permission:Update"), MultiTenancySides.Host); |
|||
productTypes.AddChild(ProductsPermissions.ProductTypes.Delete, L("Permission:Delete"), MultiTenancySides.Host); |
|||
|
|||
var categories = moduleGroup.AddPermission(ProductsPermissions.Categories.Default, L("Permission:Category")); |
|||
categories.AddChild(ProductsPermissions.Categories.CrossStore, L("Permission:CrossStore")); |
|||
categories.AddChild(ProductsPermissions.Categories.Create, L("Permission:Create")); |
|||
categories.AddChild(ProductsPermissions.Categories.Update, L("Permission:Update")); |
|||
categories.AddChild(ProductsPermissions.Categories.Delete, L("Permission:Delete")); |
|||
|
|||
var product = moduleGroup.AddPermission(ProductsPermissions.Products.Default, L("Permission:Product")); |
|||
product.AddChild(ProductsPermissions.Products.CrossStore, L("Permission:CrossStore")); |
|||
product.AddChild(ProductsPermissions.Products.Create, L("Permission:Create")); |
|||
product.AddChild(ProductsPermissions.Products.Update, L("Permission:Update")); |
|||
product.AddChild(ProductsPermissions.Products.Delete, L("Permission:Delete")); |
|||
} |
|||
|
|||
private static LocalizableString L(string name) |
|||
{ |
|||
return LocalizableString.Create<ProductsResource>(name); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,40 @@ |
|||
using Volo.Abp.Reflection; |
|||
|
|||
namespace EasyAbp.EShop.Products.Authorization |
|||
{ |
|||
public class ProductsPermissions |
|||
{ |
|||
public const string GroupName = "Products"; |
|||
|
|||
public class ProductTypes |
|||
{ |
|||
public const string Default = GroupName + ".ProductType"; |
|||
public const string Delete = Default + ".Delete"; |
|||
public const string Update = Default + ".Update"; |
|||
public const string Create = Default + ".Create"; |
|||
} |
|||
|
|||
public class Categories |
|||
{ |
|||
public const string Default = GroupName + ".Category"; |
|||
public const string CrossStore = Default + ".CrossStore"; |
|||
public const string Delete = Default + ".Delete"; |
|||
public const string Update = Default + ".Update"; |
|||
public const string Create = Default + ".Create"; |
|||
} |
|||
|
|||
public class Products |
|||
{ |
|||
public const string Default = GroupName + ".Product"; |
|||
public const string CrossStore = Default + ".CrossStore"; |
|||
public const string Delete = Default + ".Delete"; |
|||
public const string Update = Default + ".Update"; |
|||
public const string Create = Default + ".Create"; |
|||
} |
|||
|
|||
public static string[] GetAll() |
|||
{ |
|||
return ReflectionHelper.GetPublicConstantsRecursively(typeof(ProductsPermissions)); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
using System; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Products.Categories.Dtos |
|||
{ |
|||
public class CategoryDto : FullAuditedEntityDto<Guid> |
|||
{ |
|||
public Guid? ParentCategoryId { get; set; } |
|||
|
|||
public string DisplayName { get; set; } |
|||
|
|||
public string Description { get; set; } |
|||
|
|||
public string MediaResources { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
using System; |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Products.Categories.Dtos |
|||
{ |
|||
public class CreateUpdateCategoryDto |
|||
{ |
|||
[DisplayName("CategoryParentCategoryId")] |
|||
public Guid? ParentCategoryId { get; set; } |
|||
|
|||
[Required] |
|||
[DisplayName("CategoryDisplayName")] |
|||
public string DisplayName { get; set; } |
|||
|
|||
[DisplayName("CategoryDescription")] |
|||
public string Description { get; set; } |
|||
|
|||
[DisplayName("CategoryMediaResources")] |
|||
public string MediaResources { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Products.Categories.Dtos; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Products.Categories |
|||
{ |
|||
public interface ICategoryAppService : |
|||
ICrudAppService< |
|||
CategoryDto, |
|||
Guid, |
|||
PagedAndSortedResultRequestDto, |
|||
CreateUpdateCategoryDto, |
|||
CreateUpdateCategoryDto> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
using System; |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Products.ProductCategories.Dtos |
|||
{ |
|||
public class CreateUpdateProductCategoryDto |
|||
{ |
|||
[DisplayName("ProductCategoryStoreId")] |
|||
public Guid? StoreId { get; set; } |
|||
|
|||
[Required] |
|||
[DisplayName("ProductCategoryCategoryId")] |
|||
public Guid CategoryId { get; set; } |
|||
|
|||
[Required] |
|||
[DisplayName("ProductCategoryProductId")] |
|||
public Guid ProductId { get; set; } |
|||
|
|||
[DisplayName("ProductCategoryDisplayOrder")] |
|||
public int DisplayOrder { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
using System; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Products.ProductCategories.Dtos |
|||
{ |
|||
public class ProductCategoryDto : AuditedEntityDto<Guid> |
|||
{ |
|||
public Guid? StoreId { get; set; } |
|||
|
|||
public Guid CategoryId { get; set; } |
|||
|
|||
public Guid ProductId { get; set; } |
|||
|
|||
public int DisplayOrder { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Products.ProductCategories.Dtos; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Products.ProductCategories |
|||
{ |
|||
public interface IProductCategoryAppService : |
|||
ICrudAppService< |
|||
ProductCategoryDto, |
|||
Guid, |
|||
PagedAndSortedResultRequestDto, |
|||
CreateUpdateProductCategoryDto, |
|||
CreateUpdateProductCategoryDto> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
using System; |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Volo.Abp.MultiTenancy; |
|||
|
|||
namespace EasyAbp.EShop.Products.ProductTypes.Dtos |
|||
{ |
|||
public class CreateUpdateProductTypeDto |
|||
{ |
|||
[Required] |
|||
[DisplayName("ProductTypeName")] |
|||
public string Name { get; set; } |
|||
|
|||
[Required] |
|||
[DisplayName("ProductTypeDisplayName")] |
|||
public string DisplayName { get; set; } |
|||
|
|||
[DisplayName("ProductTypeDescription")] |
|||
public string Description { get; set; } |
|||
|
|||
[DisplayName("ProductTypeMultiTenancySide")] |
|||
public MultiTenancySides MultiTenancySide { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
using System; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.MultiTenancy; |
|||
|
|||
namespace EasyAbp.EShop.Products.ProductTypes.Dtos |
|||
{ |
|||
public class ProductTypeDto : FullAuditedEntityDto<Guid> |
|||
{ |
|||
public string Name { get; set; } |
|||
|
|||
public string DisplayName { get; set; } |
|||
|
|||
public string Description { get; set; } |
|||
|
|||
public MultiTenancySides MultiTenancySide { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Products.ProductTypes.Dtos; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Products.ProductTypes |
|||
{ |
|||
public interface IProductTypeAppService : |
|||
ICrudAppService< |
|||
ProductTypeDto, |
|||
Guid, |
|||
PagedAndSortedResultRequestDto, |
|||
CreateUpdateProductTypeDto, |
|||
CreateUpdateProductTypeDto> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
using System; |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Products.Products.Dtos |
|||
{ |
|||
public class CreateUpdateProductDetailDto |
|||
{ |
|||
[DisplayName("ProductDetailDescription")] |
|||
public string Description { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
using System; |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Products.Products.Dtos |
|||
{ |
|||
public class CreateUpdateProductDto |
|||
{ |
|||
[DisplayName("ProductStoreId")] |
|||
public Guid? StoreId { get; set; } |
|||
|
|||
[Required] |
|||
[DisplayName("ProductProductTypeId")] |
|||
public Guid ProductTypeId { get; set; } |
|||
|
|||
[Required] |
|||
[DisplayName("ProductDisplayName")] |
|||
public string DisplayName { get; set; } |
|||
|
|||
public CreateUpdateProductDetailDto ProductDetail { get; set; } |
|||
|
|||
[DisplayName("ProductInventoryStrategy")] |
|||
public InventoryStrategy InventoryStrategy { get; set; } |
|||
|
|||
[DisplayName("ProductMediaResources")] |
|||
public string MediaResources { get; set; } |
|||
|
|||
[DisplayName("ProductIsPublished")] |
|||
public bool IsPublished { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
using System; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Products.Products.Dtos |
|||
{ |
|||
public class GetProductListDto : PagedAndSortedResultRequestDto |
|||
{ |
|||
public Guid? StoreId { get; set; } |
|||
|
|||
public Guid? CategoryId { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Products.Products.Dtos |
|||
{ |
|||
public class ProductAttributeDto : FullAuditedEntityDto<Guid> |
|||
{ |
|||
[Required] |
|||
public string DisplayName { get; set; } |
|||
|
|||
public string Description { get; set; } |
|||
|
|||
public IEnumerable<ProductAttributeOptionDto> ProductAttributeOptions { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Products.Products.Dtos |
|||
{ |
|||
public class ProductAttributeOptionDto : FullAuditedEntityDto<Guid> |
|||
{ |
|||
[Required] |
|||
public string DisplayName { get; set; } |
|||
|
|||
public string Description { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Products.Products.Dtos |
|||
{ |
|||
public class ProductDetailDto : EntityDto |
|||
{ |
|||
public string Description { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Products.Products.Dtos |
|||
{ |
|||
public class ProductDto : FullAuditedEntityDto<Guid> |
|||
{ |
|||
public Guid? StoreId { get; set; } |
|||
|
|||
public Guid ProductTypeId { get; set; } |
|||
|
|||
public string DisplayName { get; set; } |
|||
|
|||
public InventoryStrategy InventoryStrategy { get; set; } |
|||
|
|||
public string MediaResources { get; set; } |
|||
|
|||
public bool IsPublished { get; set; } |
|||
|
|||
public ProductDetailDto ProductDetail { get; set; } |
|||
|
|||
public IEnumerable<ProductAttributeDto> ProductAttributes { get; set; } |
|||
|
|||
public IEnumerable<ProductSkuDto> ProductSkus { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
using System; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Products.Products.Dtos |
|||
{ |
|||
public class ProductSkuDto : FullAuditedEntityDto<Guid> |
|||
{ |
|||
public string SerializedAttributeOptionIds { get; set; } |
|||
|
|||
public decimal OriginalPrice { get; set; } |
|||
|
|||
public decimal Price { get; set; } |
|||
|
|||
public int Inventory { get; set; } |
|||
|
|||
public int Sold { get; set; } |
|||
|
|||
public int OrderMinQuantity { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Products.Products.Dtos; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Products.Products |
|||
{ |
|||
public interface IProductAppService : |
|||
ICrudAppService< |
|||
ProductDto, |
|||
Guid, |
|||
GetProductListDto, |
|||
CreateUpdateProductDto, |
|||
CreateUpdateProductDto> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Products.Authorization; |
|||
using EasyAbp.EShop.Products.Categories.Dtos; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Products.Categories |
|||
{ |
|||
public class CategoryAppService : CrudAppService<Category, CategoryDto, Guid, PagedAndSortedResultRequestDto, CreateUpdateCategoryDto, CreateUpdateCategoryDto>, |
|||
ICategoryAppService |
|||
{ |
|||
protected override string CreatePolicyName { get; set; } = ProductsPermissions.Categories.Create; |
|||
protected override string DeletePolicyName { get; set; } = ProductsPermissions.Categories.Delete; |
|||
protected override string UpdatePolicyName { get; set; } = ProductsPermissions.Categories.Update; |
|||
protected override string GetPolicyName { get; set; } = ProductsPermissions.Categories.Default; |
|||
protected override string GetListPolicyName { get; set; } = ProductsPermissions.Categories.Default; |
|||
|
|||
private readonly ICategoryRepository _repository; |
|||
|
|||
public CategoryAppService(ICategoryRepository repository) : base(repository) |
|||
{ |
|||
_repository = repository; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Products.Authorization; |
|||
using EasyAbp.EShop.Products.ProductCategories.Dtos; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Products.ProductCategories |
|||
{ |
|||
public class ProductCategoryAppService : CrudAppService<ProductCategory, ProductCategoryDto, Guid, PagedAndSortedResultRequestDto, CreateUpdateProductCategoryDto, CreateUpdateProductCategoryDto>, |
|||
IProductCategoryAppService |
|||
{ |
|||
protected override string CreatePolicyName { get; set; } = ProductsPermissions.Products.Create; |
|||
protected override string DeletePolicyName { get; set; } = ProductsPermissions.Products.Delete; |
|||
protected override string UpdatePolicyName { get; set; } = ProductsPermissions.Products.Update; |
|||
protected override string GetPolicyName { get; set; } = ProductsPermissions.Products.Default; |
|||
protected override string GetListPolicyName { get; set; } = ProductsPermissions.Products.Default; |
|||
|
|||
private readonly IProductCategoryRepository _repository; |
|||
|
|||
public ProductCategoryAppService(IProductCategoryRepository repository) : base(repository) |
|||
{ |
|||
_repository = repository; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Products.Authorization; |
|||
using EasyAbp.EShop.Products.ProductTypes.Dtos; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Products.ProductTypes |
|||
{ |
|||
public class ProductTypeAppService : CrudAppService<ProductType, ProductTypeDto, Guid, PagedAndSortedResultRequestDto, CreateUpdateProductTypeDto, CreateUpdateProductTypeDto>, |
|||
IProductTypeAppService |
|||
{ |
|||
protected override string CreatePolicyName { get; set; } = ProductsPermissions.ProductTypes.Create; |
|||
protected override string DeletePolicyName { get; set; } = ProductsPermissions.ProductTypes.Delete; |
|||
protected override string UpdatePolicyName { get; set; } = ProductsPermissions.ProductTypes.Update; |
|||
protected override string GetPolicyName { get; set; } = ProductsPermissions.ProductTypes.Default; |
|||
protected override string GetListPolicyName { get; set; } = ProductsPermissions.ProductTypes.Default; |
|||
|
|||
private readonly IProductTypeRepository _repository; |
|||
|
|||
public ProductTypeAppService(IProductTypeRepository repository) : base(repository) |
|||
{ |
|||
_repository = repository; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,66 @@ |
|||
using System; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Products.Authorization; |
|||
using EasyAbp.EShop.Products.ProductCategories; |
|||
using EasyAbp.EShop.Products.Products.Dtos; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Threading; |
|||
|
|||
namespace EasyAbp.EShop.Products.Products |
|||
{ |
|||
public class ProductAppService : CrudAppService<Product, ProductDto, Guid, GetProductListDto, CreateUpdateProductDto, CreateUpdateProductDto>, |
|||
IProductAppService |
|||
{ |
|||
protected override string CreatePolicyName { get; set; } = ProductsPermissions.Products.Create; |
|||
protected override string DeletePolicyName { get; set; } = ProductsPermissions.Products.Delete; |
|||
protected override string UpdatePolicyName { get; set; } = ProductsPermissions.Products.Update; |
|||
protected override string GetPolicyName { get; set; } = ProductsPermissions.Products.Default; |
|||
protected override string GetListPolicyName { get; set; } = ProductsPermissions.Products.Default; |
|||
|
|||
private readonly IProductCategoryRepository _productCategoryRepository; |
|||
private readonly IProductRepository _repository; |
|||
|
|||
public ProductAppService( |
|||
IProductCategoryRepository productCategoryRepository, |
|||
IProductRepository repository) : base(repository) |
|||
{ |
|||
_productCategoryRepository = productCategoryRepository; |
|||
_repository = repository; |
|||
} |
|||
|
|||
protected override IQueryable<Product> CreateFilteredQuery(GetProductListDto input) |
|||
{ |
|||
var query = base.CreateFilteredQuery(input); |
|||
|
|||
if (input.CategoryId.HasValue) |
|||
{ |
|||
var productIds = AsyncHelper |
|||
.RunSync(() => _productCategoryRepository.GetListByCategoryId(input.CategoryId.Value, input.StoreId)) |
|||
.Select(pc => pc.ProductId).ToList(); |
|||
|
|||
query = query.Where(p => productIds.Contains(p.Id)); |
|||
} |
|||
else if (input.StoreId.HasValue) |
|||
{ |
|||
query = query.Where(p => p.StoreId == input.StoreId); |
|||
} |
|||
|
|||
return query; |
|||
} |
|||
|
|||
public override async Task<ProductDto> CreateAsync(CreateUpdateProductDto input) |
|||
{ |
|||
await CheckCreatePolicyAsync(); |
|||
|
|||
var entity = MapToEntity(input); |
|||
|
|||
TryToSetTenantId(entity); |
|||
|
|||
await Repository.InsertAsync(entity, autoSave: true); |
|||
|
|||
return MapToGetOutputDto(entity); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,39 @@ |
|||
using EasyAbp.EShop.Products.Products; |
|||
using EasyAbp.EShop.Products.Products.Dtos; |
|||
using EasyAbp.EShop.Products.Categories; |
|||
using EasyAbp.EShop.Products.Categories.Dtos; |
|||
using EasyAbp.EShop.Products.ProductTypes; |
|||
using EasyAbp.EShop.Products.ProductTypes.Dtos; |
|||
using EasyAbp.EShop.Products.ProductCategories; |
|||
using EasyAbp.EShop.Products.ProductCategories.Dtos; |
|||
using AutoMapper; |
|||
using Volo.Abp.AutoMapper; |
|||
|
|||
namespace EasyAbp.EShop.Products |
|||
{ |
|||
public class ProductsApplicationAutoMapperProfile : Profile |
|||
{ |
|||
public ProductsApplicationAutoMapperProfile() |
|||
{ |
|||
/* 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>(); |
|||
CreateMap<ProductDetail, ProductDetailDto>(); |
|||
CreateMap<ProductAttribute, ProductAttributeDto>(); |
|||
CreateMap<ProductAttributeOption, ProductAttributeOptionDto>(); |
|||
CreateMap<ProductSku, ProductSkuDto>(); |
|||
CreateMap<CreateUpdateProductDto, Product>(MemberList.Source) |
|||
.Ignore(p => p.ProductDetail) |
|||
.Ignore(p => p.ProductAttributes) |
|||
.Ignore(p => p.ProductSkus); |
|||
CreateMap<CreateUpdateProductDetailDto, ProductDetail>(MemberList.Source); |
|||
CreateMap<Category, CategoryDto>(); |
|||
CreateMap<CreateUpdateCategoryDto, Category>(MemberList.Source); |
|||
CreateMap<ProductType, ProductTypeDto>(); |
|||
CreateMap<CreateUpdateProductTypeDto, ProductType>(MemberList.Source); |
|||
CreateMap<ProductCategory, ProductCategoryDto>(); |
|||
CreateMap<CreateUpdateProductCategoryDto, ProductCategory>(MemberList.Source); |
|||
} |
|||
} |
|||
} |
|||
@ -1,14 +0,0 @@ |
|||
using AutoMapper; |
|||
|
|||
namespace EasyAbp.EShop.Products |
|||
{ |
|||
public class ProductsApplicationAutoMapperProfile : Profile |
|||
{ |
|||
public ProductsApplicationAutoMapperProfile() |
|||
{ |
|||
/* You can configure your AutoMapper mapping configuration here. |
|||
* Alternatively, you can split your mapping configurations |
|||
* into multiple profile classes for a better organization. */ |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,48 @@ |
|||
{ |
|||
"culture": "cs", |
|||
"texts": { |
|||
"Menu:Product": "MenuProduct", |
|||
"Product": "Product", |
|||
"ProductTenantId": "ProductTenantId", |
|||
"ProductStoreId": "ProductStoreId", |
|||
"ProductProductTypeId": "ProductProductTypeId", |
|||
"ProductDisplayName": "ProductDisplayName", |
|||
"ProductDetailDescription": "ProductDetailDescription", |
|||
"ProductInventoryStrategy": "ProductInventoryStrategy", |
|||
"ProductIsPublished": "ProductIsPublished", |
|||
"ProductMediaResources": "ProductMediaResources", |
|||
"CreateProduct": "CreateProduct", |
|||
"EditProduct": "EditProduct", |
|||
"ProductDeletionConfirmationMessage": "Are you sure to delete the product {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Menu:Category": "MenuCategory", |
|||
"Category": "Category", |
|||
"CategoryTenantId": "CategoryTenantId", |
|||
"CategoryParentCategoryId": "CategoryParentCategoryId", |
|||
"CategoryDisplayName": "CategoryDisplayName", |
|||
"CategoryDescription": "CategoryDescription", |
|||
"CategoryMediaResources": "CategoryMediaResources", |
|||
"CreateCategory": "CreateCategory", |
|||
"EditCategory": "EditCategory", |
|||
"CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?", |
|||
"Menu:ProductType": "MenuProductType", |
|||
"ProductType": "ProductType", |
|||
"ProductTypeName": "ProductTypeName", |
|||
"ProductTypeDisplayName": "ProductTypeDisplayName", |
|||
"ProductTypeDescription": "ProductTypeDescription", |
|||
"ProductTypeMultiTenancySide": "ProductTypeMultiTenancySide", |
|||
"CreateProductType": "CreateProductType", |
|||
"EditProductType": "EditProductType", |
|||
"ProductTypeDeletionConfirmationMessage": "Are you sure to delete the producttype {0}?", |
|||
"Menu:ProductCategory": "MenuProductCategory", |
|||
"ProductCategory": "ProductCategory", |
|||
"ProductCategoryTenantId": "ProductCategoryTenantId", |
|||
"ProductCategoryStoreId": "ProductCategoryStoreId", |
|||
"ProductCategoryCategoryId": "ProductCategoryCategoryId", |
|||
"ProductCategoryProductId": "ProductCategoryProductId", |
|||
"ProductCategoryDisplayOrder": "ProductCategoryDisplayOrder", |
|||
"CreateProductCategory": "CreateProductCategory", |
|||
"EditProductCategory": "EditProductCategory", |
|||
"ProductCategoryDeletionConfirmationMessage": "Are you sure to delete the productcategory {0}?" |
|||
} |
|||
} |
|||
@ -0,0 +1,49 @@ |
|||
{ |
|||
"culture": "en", |
|||
"texts": { |
|||
"ManageYourProfile": "Manage your profile", |
|||
"Menu:Product": "MenuProduct", |
|||
"Product": "Product", |
|||
"ProductTenantId": "ProductTenantId", |
|||
"ProductStoreId": "ProductStoreId", |
|||
"ProductProductTypeId": "ProductProductTypeId", |
|||
"ProductDisplayName": "ProductDisplayName", |
|||
"ProductDetailDescription": "ProductDetailDescription", |
|||
"ProductInventoryStrategy": "ProductInventoryStrategy", |
|||
"ProductIsPublished": "ProductIsPublished", |
|||
"ProductMediaResources": "ProductMediaResources", |
|||
"CreateProduct": "CreateProduct", |
|||
"EditProduct": "EditProduct", |
|||
"ProductDeletionConfirmationMessage": "Are you sure to delete the product {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Menu:Category": "MenuCategory", |
|||
"Category": "Category", |
|||
"CategoryTenantId": "CategoryTenantId", |
|||
"CategoryParentCategoryId": "CategoryParentCategoryId", |
|||
"CategoryDisplayName": "CategoryDisplayName", |
|||
"CategoryDescription": "CategoryDescription", |
|||
"CategoryMediaResources": "CategoryMediaResources", |
|||
"CreateCategory": "CreateCategory", |
|||
"EditCategory": "EditCategory", |
|||
"CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?", |
|||
"Menu:ProductType": "MenuProductType", |
|||
"ProductType": "ProductType", |
|||
"ProductTypeName": "ProductTypeName", |
|||
"ProductTypeDisplayName": "ProductTypeDisplayName", |
|||
"ProductTypeDescription": "ProductTypeDescription", |
|||
"ProductTypeMultiTenancySide": "ProductTypeMultiTenancySide", |
|||
"CreateProductType": "CreateProductType", |
|||
"EditProductType": "EditProductType", |
|||
"ProductTypeDeletionConfirmationMessage": "Are you sure to delete the producttype {0}?", |
|||
"Menu:ProductCategory": "MenuProductCategory", |
|||
"ProductCategory": "ProductCategory", |
|||
"ProductCategoryTenantId": "ProductCategoryTenantId", |
|||
"ProductCategoryStoreId": "ProductCategoryStoreId", |
|||
"ProductCategoryCategoryId": "ProductCategoryCategoryId", |
|||
"ProductCategoryProductId": "ProductCategoryProductId", |
|||
"ProductCategoryDisplayOrder": "ProductCategoryDisplayOrder", |
|||
"CreateProductCategory": "CreateProductCategory", |
|||
"EditProductCategory": "EditProductCategory", |
|||
"ProductCategoryDeletionConfirmationMessage": "Are you sure to delete the productcategory {0}?" |
|||
} |
|||
} |
|||
@ -0,0 +1,48 @@ |
|||
{ |
|||
"culture": "pl", |
|||
"texts": { |
|||
"Menu:Product": "MenuProduct", |
|||
"Product": "Product", |
|||
"ProductTenantId": "ProductTenantId", |
|||
"ProductStoreId": "ProductStoreId", |
|||
"ProductProductTypeId": "ProductProductTypeId", |
|||
"ProductDisplayName": "ProductDisplayName", |
|||
"ProductDetailDescription": "ProductDetailDescription", |
|||
"ProductInventoryStrategy": "ProductInventoryStrategy", |
|||
"ProductIsPublished": "ProductIsPublished", |
|||
"ProductMediaResources": "ProductMediaResources", |
|||
"CreateProduct": "CreateProduct", |
|||
"EditProduct": "EditProduct", |
|||
"ProductDeletionConfirmationMessage": "Are you sure to delete the product {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Menu:Category": "MenuCategory", |
|||
"Category": "Category", |
|||
"CategoryTenantId": "CategoryTenantId", |
|||
"CategoryParentCategoryId": "CategoryParentCategoryId", |
|||
"CategoryDisplayName": "CategoryDisplayName", |
|||
"CategoryDescription": "CategoryDescription", |
|||
"CategoryMediaResources": "CategoryMediaResources", |
|||
"CreateCategory": "CreateCategory", |
|||
"EditCategory": "EditCategory", |
|||
"CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?", |
|||
"Menu:ProductType": "MenuProductType", |
|||
"ProductType": "ProductType", |
|||
"ProductTypeName": "ProductTypeName", |
|||
"ProductTypeDisplayName": "ProductTypeDisplayName", |
|||
"ProductTypeDescription": "ProductTypeDescription", |
|||
"ProductTypeMultiTenancySide": "ProductTypeMultiTenancySide", |
|||
"CreateProductType": "CreateProductType", |
|||
"EditProductType": "EditProductType", |
|||
"ProductTypeDeletionConfirmationMessage": "Are you sure to delete the producttype {0}?", |
|||
"Menu:ProductCategory": "MenuProductCategory", |
|||
"ProductCategory": "ProductCategory", |
|||
"ProductCategoryTenantId": "ProductCategoryTenantId", |
|||
"ProductCategoryStoreId": "ProductCategoryStoreId", |
|||
"ProductCategoryCategoryId": "ProductCategoryCategoryId", |
|||
"ProductCategoryProductId": "ProductCategoryProductId", |
|||
"ProductCategoryDisplayOrder": "ProductCategoryDisplayOrder", |
|||
"CreateProductCategory": "CreateProductCategory", |
|||
"EditProductCategory": "EditProductCategory", |
|||
"ProductCategoryDeletionConfirmationMessage": "Are you sure to delete the productcategory {0}?" |
|||
} |
|||
} |
|||
@ -0,0 +1,48 @@ |
|||
{ |
|||
"culture": "pt-BR", |
|||
"texts": { |
|||
"Menu:Product": "MenuProduct", |
|||
"Product": "Product", |
|||
"ProductTenantId": "ProductTenantId", |
|||
"ProductStoreId": "ProductStoreId", |
|||
"ProductProductTypeId": "ProductProductTypeId", |
|||
"ProductDisplayName": "ProductDisplayName", |
|||
"ProductDetailDescription": "ProductDetailDescription", |
|||
"ProductInventoryStrategy": "ProductInventoryStrategy", |
|||
"ProductIsPublished": "ProductIsPublished", |
|||
"ProductMediaResources": "ProductMediaResources", |
|||
"CreateProduct": "CreateProduct", |
|||
"EditProduct": "EditProduct", |
|||
"ProductDeletionConfirmationMessage": "Are you sure to delete the product {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Menu:Category": "MenuCategory", |
|||
"Category": "Category", |
|||
"CategoryTenantId": "CategoryTenantId", |
|||
"CategoryParentCategoryId": "CategoryParentCategoryId", |
|||
"CategoryDisplayName": "CategoryDisplayName", |
|||
"CategoryDescription": "CategoryDescription", |
|||
"CategoryMediaResources": "CategoryMediaResources", |
|||
"CreateCategory": "CreateCategory", |
|||
"EditCategory": "EditCategory", |
|||
"CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?", |
|||
"Menu:ProductType": "MenuProductType", |
|||
"ProductType": "ProductType", |
|||
"ProductTypeName": "ProductTypeName", |
|||
"ProductTypeDisplayName": "ProductTypeDisplayName", |
|||
"ProductTypeDescription": "ProductTypeDescription", |
|||
"ProductTypeMultiTenancySide": "ProductTypeMultiTenancySide", |
|||
"CreateProductType": "CreateProductType", |
|||
"EditProductType": "EditProductType", |
|||
"ProductTypeDeletionConfirmationMessage": "Are you sure to delete the producttype {0}?", |
|||
"Menu:ProductCategory": "MenuProductCategory", |
|||
"ProductCategory": "ProductCategory", |
|||
"ProductCategoryTenantId": "ProductCategoryTenantId", |
|||
"ProductCategoryStoreId": "ProductCategoryStoreId", |
|||
"ProductCategoryCategoryId": "ProductCategoryCategoryId", |
|||
"ProductCategoryProductId": "ProductCategoryProductId", |
|||
"ProductCategoryDisplayOrder": "ProductCategoryDisplayOrder", |
|||
"CreateProductCategory": "CreateProductCategory", |
|||
"EditProductCategory": "EditProductCategory", |
|||
"ProductCategoryDeletionConfirmationMessage": "Are you sure to delete the productcategory {0}?" |
|||
} |
|||
} |
|||
@ -0,0 +1,49 @@ |
|||
{ |
|||
"culture": "sl", |
|||
"texts": { |
|||
"ManageYourProfile": "Upravljajte svojim profilom", |
|||
"Menu:Product": "MenuProduct", |
|||
"Product": "Product", |
|||
"ProductTenantId": "ProductTenantId", |
|||
"ProductStoreId": "ProductStoreId", |
|||
"ProductProductTypeId": "ProductProductTypeId", |
|||
"ProductDisplayName": "ProductDisplayName", |
|||
"ProductDetailDescription": "ProductDetailDescription", |
|||
"ProductInventoryStrategy": "ProductInventoryStrategy", |
|||
"ProductIsPublished": "ProductIsPublished", |
|||
"ProductMediaResources": "ProductMediaResources", |
|||
"CreateProduct": "CreateProduct", |
|||
"EditProduct": "EditProduct", |
|||
"ProductDeletionConfirmationMessage": "Are you sure to delete the product {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Menu:Category": "MenuCategory", |
|||
"Category": "Category", |
|||
"CategoryTenantId": "CategoryTenantId", |
|||
"CategoryParentCategoryId": "CategoryParentCategoryId", |
|||
"CategoryDisplayName": "CategoryDisplayName", |
|||
"CategoryDescription": "CategoryDescription", |
|||
"CategoryMediaResources": "CategoryMediaResources", |
|||
"CreateCategory": "CreateCategory", |
|||
"EditCategory": "EditCategory", |
|||
"CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?", |
|||
"Menu:ProductType": "MenuProductType", |
|||
"ProductType": "ProductType", |
|||
"ProductTypeName": "ProductTypeName", |
|||
"ProductTypeDisplayName": "ProductTypeDisplayName", |
|||
"ProductTypeDescription": "ProductTypeDescription", |
|||
"ProductTypeMultiTenancySide": "ProductTypeMultiTenancySide", |
|||
"CreateProductType": "CreateProductType", |
|||
"EditProductType": "EditProductType", |
|||
"ProductTypeDeletionConfirmationMessage": "Are you sure to delete the producttype {0}?", |
|||
"Menu:ProductCategory": "MenuProductCategory", |
|||
"ProductCategory": "ProductCategory", |
|||
"ProductCategoryTenantId": "ProductCategoryTenantId", |
|||
"ProductCategoryStoreId": "ProductCategoryStoreId", |
|||
"ProductCategoryCategoryId": "ProductCategoryCategoryId", |
|||
"ProductCategoryProductId": "ProductCategoryProductId", |
|||
"ProductCategoryDisplayOrder": "ProductCategoryDisplayOrder", |
|||
"CreateProductCategory": "CreateProductCategory", |
|||
"EditProductCategory": "EditProductCategory", |
|||
"ProductCategoryDeletionConfirmationMessage": "Are you sure to delete the productcategory {0}?" |
|||
} |
|||
} |
|||
@ -0,0 +1,49 @@ |
|||
{ |
|||
"culture": "tr", |
|||
"texts": { |
|||
"ManageYourProfile": "Profil y�netimi", |
|||
"Menu:Product": "MenuProduct", |
|||
"Product": "Product", |
|||
"ProductTenantId": "ProductTenantId", |
|||
"ProductStoreId": "ProductStoreId", |
|||
"ProductProductTypeId": "ProductProductTypeId", |
|||
"ProductDisplayName": "ProductDisplayName", |
|||
"ProductDetailDescription": "ProductDetailDescription", |
|||
"ProductInventoryStrategy": "ProductInventoryStrategy", |
|||
"ProductIsPublished": "ProductIsPublished", |
|||
"ProductMediaResources": "ProductMediaResources", |
|||
"CreateProduct": "CreateProduct", |
|||
"EditProduct": "EditProduct", |
|||
"ProductDeletionConfirmationMessage": "Are you sure to delete the product {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Menu:Category": "MenuCategory", |
|||
"Category": "Category", |
|||
"CategoryTenantId": "CategoryTenantId", |
|||
"CategoryParentCategoryId": "CategoryParentCategoryId", |
|||
"CategoryDisplayName": "CategoryDisplayName", |
|||
"CategoryDescription": "CategoryDescription", |
|||
"CategoryMediaResources": "CategoryMediaResources", |
|||
"CreateCategory": "CreateCategory", |
|||
"EditCategory": "EditCategory", |
|||
"CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?", |
|||
"Menu:ProductType": "MenuProductType", |
|||
"ProductType": "ProductType", |
|||
"ProductTypeName": "ProductTypeName", |
|||
"ProductTypeDisplayName": "ProductTypeDisplayName", |
|||
"ProductTypeDescription": "ProductTypeDescription", |
|||
"ProductTypeMultiTenancySide": "ProductTypeMultiTenancySide", |
|||
"CreateProductType": "CreateProductType", |
|||
"EditProductType": "EditProductType", |
|||
"ProductTypeDeletionConfirmationMessage": "Are you sure to delete the producttype {0}?", |
|||
"Menu:ProductCategory": "MenuProductCategory", |
|||
"ProductCategory": "ProductCategory", |
|||
"ProductCategoryTenantId": "ProductCategoryTenantId", |
|||
"ProductCategoryStoreId": "ProductCategoryStoreId", |
|||
"ProductCategoryCategoryId": "ProductCategoryCategoryId", |
|||
"ProductCategoryProductId": "ProductCategoryProductId", |
|||
"ProductCategoryDisplayOrder": "ProductCategoryDisplayOrder", |
|||
"CreateProductCategory": "CreateProductCategory", |
|||
"EditProductCategory": "EditProductCategory", |
|||
"ProductCategoryDeletionConfirmationMessage": "Are you sure to delete the productcategory {0}?" |
|||
} |
|||
} |
|||
@ -0,0 +1,48 @@ |
|||
{ |
|||
"culture": "vi", |
|||
"texts": { |
|||
"Menu:Product": "MenuProduct", |
|||
"Product": "Product", |
|||
"ProductTenantId": "ProductTenantId", |
|||
"ProductStoreId": "ProductStoreId", |
|||
"ProductProductTypeId": "ProductProductTypeId", |
|||
"ProductDisplayName": "ProductDisplayName", |
|||
"ProductDetailDescription": "ProductDetailDescription", |
|||
"ProductInventoryStrategy": "ProductInventoryStrategy", |
|||
"ProductIsPublished": "ProductIsPublished", |
|||
"ProductMediaResources": "ProductMediaResources", |
|||
"CreateProduct": "CreateProduct", |
|||
"EditProduct": "EditProduct", |
|||
"ProductDeletionConfirmationMessage": "Are you sure to delete the product {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Menu:Category": "MenuCategory", |
|||
"Category": "Category", |
|||
"CategoryTenantId": "CategoryTenantId", |
|||
"CategoryParentCategoryId": "CategoryParentCategoryId", |
|||
"CategoryDisplayName": "CategoryDisplayName", |
|||
"CategoryDescription": "CategoryDescription", |
|||
"CategoryMediaResources": "CategoryMediaResources", |
|||
"CreateCategory": "CreateCategory", |
|||
"EditCategory": "EditCategory", |
|||
"CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?", |
|||
"Menu:ProductType": "MenuProductType", |
|||
"ProductType": "ProductType", |
|||
"ProductTypeName": "ProductTypeName", |
|||
"ProductTypeDisplayName": "ProductTypeDisplayName", |
|||
"ProductTypeDescription": "ProductTypeDescription", |
|||
"ProductTypeMultiTenancySide": "ProductTypeMultiTenancySide", |
|||
"CreateProductType": "CreateProductType", |
|||
"EditProductType": "EditProductType", |
|||
"ProductTypeDeletionConfirmationMessage": "Are you sure to delete the producttype {0}?", |
|||
"Menu:ProductCategory": "MenuProductCategory", |
|||
"ProductCategory": "ProductCategory", |
|||
"ProductCategoryTenantId": "ProductCategoryTenantId", |
|||
"ProductCategoryStoreId": "ProductCategoryStoreId", |
|||
"ProductCategoryCategoryId": "ProductCategoryCategoryId", |
|||
"ProductCategoryProductId": "ProductCategoryProductId", |
|||
"ProductCategoryDisplayOrder": "ProductCategoryDisplayOrder", |
|||
"CreateProductCategory": "CreateProductCategory", |
|||
"EditProductCategory": "EditProductCategory", |
|||
"ProductCategoryDeletionConfirmationMessage": "Are you sure to delete the productcategory {0}?" |
|||
} |
|||
} |
|||
@ -0,0 +1,49 @@ |
|||
{ |
|||
"culture": "zh-Hans", |
|||
"texts": { |
|||
"ManageYourProfile": "管理个人资料", |
|||
"Menu:Product": "MenuProduct", |
|||
"Product": "Product", |
|||
"ProductTenantId": "ProductTenantId", |
|||
"ProductStoreId": "ProductStoreId", |
|||
"ProductProductTypeId": "ProductProductTypeId", |
|||
"ProductDisplayName": "ProductDisplayName", |
|||
"ProductDetailDescription": "ProductDetailDescription", |
|||
"ProductInventoryStrategy": "ProductInventoryStrategy", |
|||
"ProductIsPublished": "ProductIsPublished", |
|||
"ProductMediaResources": "ProductMediaResources", |
|||
"CreateProduct": "CreateProduct", |
|||
"EditProduct": "EditProduct", |
|||
"ProductDeletionConfirmationMessage": "Are you sure to delete the product {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Menu:Category": "MenuCategory", |
|||
"Category": "Category", |
|||
"CategoryTenantId": "CategoryTenantId", |
|||
"CategoryParentCategoryId": "CategoryParentCategoryId", |
|||
"CategoryDisplayName": "CategoryDisplayName", |
|||
"CategoryDescription": "CategoryDescription", |
|||
"CategoryMediaResources": "CategoryMediaResources", |
|||
"CreateCategory": "CreateCategory", |
|||
"EditCategory": "EditCategory", |
|||
"CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?", |
|||
"Menu:ProductType": "MenuProductType", |
|||
"ProductType": "ProductType", |
|||
"ProductTypeName": "ProductTypeName", |
|||
"ProductTypeDisplayName": "ProductTypeDisplayName", |
|||
"ProductTypeDescription": "ProductTypeDescription", |
|||
"ProductTypeMultiTenancySide": "ProductTypeMultiTenancySide", |
|||
"CreateProductType": "CreateProductType", |
|||
"EditProductType": "EditProductType", |
|||
"ProductTypeDeletionConfirmationMessage": "Are you sure to delete the producttype {0}?", |
|||
"Menu:ProductCategory": "MenuProductCategory", |
|||
"ProductCategory": "ProductCategory", |
|||
"ProductCategoryTenantId": "ProductCategoryTenantId", |
|||
"ProductCategoryStoreId": "ProductCategoryStoreId", |
|||
"ProductCategoryCategoryId": "ProductCategoryCategoryId", |
|||
"ProductCategoryProductId": "ProductCategoryProductId", |
|||
"ProductCategoryDisplayOrder": "ProductCategoryDisplayOrder", |
|||
"CreateProductCategory": "CreateProductCategory", |
|||
"EditProductCategory": "EditProductCategory", |
|||
"ProductCategoryDeletionConfirmationMessage": "Are you sure to delete the productcategory {0}?" |
|||
} |
|||
} |
|||
@ -0,0 +1,49 @@ |
|||
{ |
|||
"culture": "zh-Hant", |
|||
"texts": { |
|||
"ManageYourProfile": "管理個人資料", |
|||
"Menu:Product": "MenuProduct", |
|||
"Product": "Product", |
|||
"ProductTenantId": "ProductTenantId", |
|||
"ProductStoreId": "ProductStoreId", |
|||
"ProductProductTypeId": "ProductProductTypeId", |
|||
"ProductDisplayName": "ProductDisplayName", |
|||
"ProductDetailDescription": "ProductDetailDescription", |
|||
"ProductInventoryStrategy": "ProductInventoryStrategy", |
|||
"ProductIsPublished": "ProductIsPublished", |
|||
"ProductMediaResources": "ProductMediaResources", |
|||
"CreateProduct": "CreateProduct", |
|||
"EditProduct": "EditProduct", |
|||
"ProductDeletionConfirmationMessage": "Are you sure to delete the product {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Menu:Category": "MenuCategory", |
|||
"Category": "Category", |
|||
"CategoryTenantId": "CategoryTenantId", |
|||
"CategoryParentCategoryId": "CategoryParentCategoryId", |
|||
"CategoryDisplayName": "CategoryDisplayName", |
|||
"CategoryDescription": "CategoryDescription", |
|||
"CategoryMediaResources": "CategoryMediaResources", |
|||
"CreateCategory": "CreateCategory", |
|||
"EditCategory": "EditCategory", |
|||
"CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?", |
|||
"Menu:ProductType": "MenuProductType", |
|||
"ProductType": "ProductType", |
|||
"ProductTypeName": "ProductTypeName", |
|||
"ProductTypeDisplayName": "ProductTypeDisplayName", |
|||
"ProductTypeDescription": "ProductTypeDescription", |
|||
"ProductTypeMultiTenancySide": "ProductTypeMultiTenancySide", |
|||
"CreateProductType": "CreateProductType", |
|||
"EditProductType": "EditProductType", |
|||
"ProductTypeDeletionConfirmationMessage": "Are you sure to delete the producttype {0}?", |
|||
"Menu:ProductCategory": "MenuProductCategory", |
|||
"ProductCategory": "ProductCategory", |
|||
"ProductCategoryTenantId": "ProductCategoryTenantId", |
|||
"ProductCategoryStoreId": "ProductCategoryStoreId", |
|||
"ProductCategoryCategoryId": "ProductCategoryCategoryId", |
|||
"ProductCategoryProductId": "ProductCategoryProductId", |
|||
"ProductCategoryDisplayOrder": "ProductCategoryDisplayOrder", |
|||
"CreateProductCategory": "CreateProductCategory", |
|||
"EditProductCategory": "EditProductCategory", |
|||
"ProductCategoryDeletionConfirmationMessage": "Are you sure to delete the productcategory {0}?" |
|||
} |
|||
} |
|||
@ -1,6 +0,0 @@ |
|||
{ |
|||
"culture": "cs", |
|||
"texts": { |
|||
|
|||
} |
|||
} |
|||
@ -1,6 +0,0 @@ |
|||
{ |
|||
"culture": "en", |
|||
"texts": { |
|||
"ManageYourProfile": "Manage your profile" |
|||
} |
|||
} |
|||
@ -1,6 +0,0 @@ |
|||
{ |
|||
"culture": "pl", |
|||
"texts": { |
|||
|
|||
} |
|||
} |
|||
@ -1,6 +0,0 @@ |
|||
{ |
|||
"culture": "pt-BR", |
|||
"texts": { |
|||
|
|||
} |
|||
} |
|||
@ -1,6 +0,0 @@ |
|||
{ |
|||
"culture": "sl", |
|||
"texts": { |
|||
"ManageYourProfile": "Upravljajte svojim profilom" |
|||
} |
|||
} |
|||
@ -1,6 +0,0 @@ |
|||
{ |
|||
"culture": "tr", |
|||
"texts": { |
|||
"ManageYourProfile": "Profil yönetimi" |
|||
} |
|||
} |
|||
@ -1,6 +0,0 @@ |
|||
{ |
|||
"culture": "vi", |
|||
"texts": { |
|||
|
|||
} |
|||
} |
|||
@ -1,6 +0,0 @@ |
|||
{ |
|||
"culture": "zh-Hans", |
|||
"texts": { |
|||
"ManageYourProfile": "管理个人资料" |
|||
} |
|||
} |
|||
@ -1,6 +0,0 @@ |
|||
{ |
|||
"culture": "zh-Hant", |
|||
"texts": { |
|||
"ManageYourProfile": "管理個人資料" |
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
using System; |
|||
using Volo.Abp.Domain.Repositories; |
|||
|
|||
namespace EasyAbp.EShop.Products.Categories |
|||
{ |
|||
public interface ICategoryRepository : IRepository<Category, Guid> |
|||
{ |
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Domain.Repositories; |
|||
|
|||
namespace EasyAbp.EShop.Products.ProductCategories |
|||
{ |
|||
public interface IProductCategoryRepository : IRepository<ProductCategory, Guid> |
|||
{ |
|||
Task<IEnumerable<ProductCategory>> GetListByCategoryId(Guid categoryId, Guid? storeId, CancellationToken cancellationToken = default); |
|||
|
|||
Task<IEnumerable<ProductCategory>> GetListByProductId(Guid productId, Guid? storeId, CancellationToken cancellationToken = default); |
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
using System; |
|||
using Volo.Abp.Domain.Repositories; |
|||
|
|||
namespace EasyAbp.EShop.Products.ProductTypes |
|||
{ |
|||
public interface IProductTypeRepository : IRepository<ProductType, Guid> |
|||
{ |
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
using System; |
|||
using Volo.Abp.Domain.Repositories; |
|||
|
|||
namespace EasyAbp.EShop.Products.Products |
|||
{ |
|||
public interface IProductRepository : IRepository<Product, Guid> |
|||
{ |
|||
} |
|||
} |
|||
@ -0,0 +1,58 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using EasyAbp.EShop.Stores.Stores; |
|||
using JetBrains.Annotations; |
|||
using Volo.Abp.Domain.Entities.Auditing; |
|||
using Volo.Abp.MultiTenancy; |
|||
|
|||
namespace EasyAbp.EShop.Products.Products |
|||
{ |
|||
public class Product : FullAuditedAggregateRoot<Guid>, IMultiTenant, IMultiStore |
|||
{ |
|||
public virtual Guid? TenantId { get; protected set; } |
|||
|
|||
public virtual Guid? StoreId { get; protected set; } |
|||
|
|||
public virtual Guid ProductTypeId { get; protected set; } |
|||
|
|||
[NotNull] |
|||
public virtual string DisplayName { get; protected set; } |
|||
|
|||
public virtual InventoryStrategy InventoryStrategy { get; protected set; } |
|||
|
|||
[CanBeNull] |
|||
public virtual string MediaResources { get; protected set; } |
|||
|
|||
public virtual bool IsPublished { get; protected set; } |
|||
|
|||
public virtual ProductDetail ProductDetail { get; protected set; } |
|||
|
|||
public virtual IEnumerable<ProductAttribute> ProductAttributes { get; protected set; } |
|||
|
|||
public virtual IEnumerable<ProductSku> ProductSkus { get; protected set; } |
|||
|
|||
protected Product() |
|||
{ |
|||
} |
|||
|
|||
public Product( |
|||
Guid id, |
|||
Guid? tenantId, |
|||
Guid? storeId, |
|||
Guid productTypeId, |
|||
string displayName, |
|||
InventoryStrategy inventoryStrategy, |
|||
bool isPublished, |
|||
string mediaResources |
|||
) :base(id) |
|||
{ |
|||
TenantId = tenantId; |
|||
StoreId = storeId; |
|||
ProductTypeId = productTypeId; |
|||
DisplayName = displayName; |
|||
InventoryStrategy = inventoryStrategy; |
|||
IsPublished = isPublished; |
|||
MediaResources = mediaResources; |
|||
} |
|||
} |
|||
} |
|||
@ -1,27 +0,0 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Stores.Stores; |
|||
using JetBrains.Annotations; |
|||
using Volo.Abp.Domain.Entities.Auditing; |
|||
using Volo.Abp.MultiTenancy; |
|||
|
|||
namespace EasyAbp.EShop.Products.Products |
|||
{ |
|||
public class Product : FullAuditedAggregateRoot<Guid>, IMultiTenant, IMultiStore |
|||
{ |
|||
public virtual Guid? TenantId { get; protected set; } |
|||
|
|||
public virtual Guid? StoreId { get; protected set; } |
|||
|
|||
public virtual Guid ProductTypeId { get; protected set; } |
|||
|
|||
[NotNull] |
|||
public virtual string DisplayName { get; protected set; } |
|||
|
|||
public virtual InventoryStrategy InventoryStrategy { get; protected set; } |
|||
|
|||
public virtual bool IsPublished { get; protected set; } |
|||
|
|||
[CanBeNull] |
|||
public virtual string MediaResources { get; protected set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Products.EntityFrameworkCore; |
|||
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
namespace EasyAbp.EShop.Products.Categories |
|||
{ |
|||
public class CategoryRepository : EfCoreRepository<ProductsDbContext, Category, Guid>, ICategoryRepository |
|||
{ |
|||
public CategoryRepository(IDbContextProvider<ProductsDbContext> dbContextProvider) : base(dbContextProvider) |
|||
{ |
|||
} |
|||
} |
|||
} |
|||
12
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EntityFrameworkCore/EShopProductsEntityFrameworkCoreModule.cs → modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/EntityFrameworkCore/EShopProductsEntityFrameworkCoreModule.cs
12
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EntityFrameworkCore/EShopProductsEntityFrameworkCoreModule.cs → modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/EntityFrameworkCore/EShopProductsEntityFrameworkCoreModule.cs
@ -0,0 +1,26 @@ |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
using EasyAbp.EShop.Products.Products; |
|||
using EasyAbp.EShop.Products.Categories; |
|||
using EasyAbp.EShop.Products.ProductTypes; |
|||
using EasyAbp.EShop.Products.ProductCategories; |
|||
|
|||
namespace EasyAbp.EShop.Products.EntityFrameworkCore |
|||
{ |
|||
[ConnectionStringName(ProductsDbProperties.ConnectionStringName)] |
|||
public interface IProductsDbContext : IEfCoreDbContext |
|||
{ |
|||
/* Add DbSet for each Aggregate Root here. Example: |
|||
* DbSet<Question> Questions { get; } |
|||
*/ |
|||
DbSet<Product> Products { get; set; } |
|||
DbSet<ProductDetail> ProductDetails { get; set; } |
|||
DbSet<ProductAttribute> ProductAttributes { get; set; } |
|||
DbSet<ProductAttributeOption> ProductAttributeOptions { get; set; } |
|||
DbSet<ProductSku> ProductSkus { get; set; } |
|||
DbSet<Category> Categories { get; set; } |
|||
DbSet<ProductType> ProductTypes { get; set; } |
|||
DbSet<ProductCategory> ProductCategories { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,39 @@ |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
using EasyAbp.EShop.Products.Products; |
|||
using EasyAbp.EShop.Products.Categories; |
|||
using EasyAbp.EShop.Products.ProductTypes; |
|||
using EasyAbp.EShop.Products.ProductCategories; |
|||
|
|||
namespace EasyAbp.EShop.Products.EntityFrameworkCore |
|||
{ |
|||
[ConnectionStringName(ProductsDbProperties.ConnectionStringName)] |
|||
public class ProductsDbContext : AbpDbContext<ProductsDbContext>, IProductsDbContext |
|||
{ |
|||
/* Add DbSet for each Aggregate Root here. Example: |
|||
* public DbSet<Question> Questions { get; set; } |
|||
*/ |
|||
public DbSet<Product> Products { get; set; } |
|||
public DbSet<ProductDetail> ProductDetails { get; set; } |
|||
public DbSet<ProductAttribute> ProductAttributes { get; set; } |
|||
public DbSet<ProductAttributeOption> ProductAttributeOptions { get; set; } |
|||
public DbSet<ProductSku> ProductSkus { get; set; } |
|||
public DbSet<Category> Categories { get; set; } |
|||
public DbSet<ProductType> ProductTypes { get; set; } |
|||
public DbSet<ProductCategory> ProductCategories { get; set; } |
|||
|
|||
public ProductsDbContext(DbContextOptions<ProductsDbContext> options) |
|||
: base(options) |
|||
{ |
|||
|
|||
} |
|||
|
|||
protected override void OnModelCreating(ModelBuilder builder) |
|||
{ |
|||
base.OnModelCreating(builder); |
|||
|
|||
builder.ConfigureProducts(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,105 @@ |
|||
using EasyAbp.EShop.Products.ProductCategories; |
|||
using EasyAbp.EShop.Products.ProductTypes; |
|||
using EasyAbp.EShop.Products.Categories; |
|||
using EasyAbp.EShop.Products.Products; |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp; |
|||
using Volo.Abp.EntityFrameworkCore.Modeling; |
|||
|
|||
namespace EasyAbp.EShop.Products.EntityFrameworkCore |
|||
{ |
|||
public static class ProductsDbContextModelCreatingExtensions |
|||
{ |
|||
public static void ConfigureProducts( |
|||
this ModelBuilder builder, |
|||
Action<ProductsModelBuilderConfigurationOptions> optionsAction = null) |
|||
{ |
|||
Check.NotNull(builder, nameof(builder)); |
|||
|
|||
var options = new ProductsModelBuilderConfigurationOptions( |
|||
ProductsDbProperties.DbTablePrefix, |
|||
ProductsDbProperties.DbSchema |
|||
); |
|||
|
|||
optionsAction?.Invoke(options); |
|||
|
|||
/* Configure all entities here. Example: |
|||
|
|||
builder.Entity<Question>(b => |
|||
{ |
|||
//Configure table & schema name
|
|||
b.ToTable(options.TablePrefix + "Questions", options.Schema); |
|||
|
|||
b.ConfigureByConvention(); |
|||
|
|||
//Properties
|
|||
b.Property(q => q.Title).IsRequired().HasMaxLength(QuestionConsts.MaxTitleLength); |
|||
|
|||
//Relations
|
|||
b.HasMany(question => question.Tags).WithOne().HasForeignKey(qt => qt.QuestionId); |
|||
|
|||
//Indexes
|
|||
b.HasIndex(q => q.CreationTime); |
|||
}); |
|||
*/ |
|||
|
|||
builder.Entity<Product>(b => |
|||
{ |
|||
b.ToTable(options.TablePrefix + "Products", options.Schema); |
|||
b.ConfigureByConvention(); |
|||
/* Configure more properties here */ |
|||
}); |
|||
|
|||
builder.Entity<ProductDetail>(b => |
|||
{ |
|||
b.ToTable(options.TablePrefix + "ProductDetails", options.Schema); |
|||
b.ConfigureByConvention(); |
|||
/* Configure more properties here */ |
|||
b.HasKey(x => new { x.ProductId }); |
|||
}); |
|||
|
|||
builder.Entity<ProductAttribute>(b => |
|||
{ |
|||
b.ToTable(options.TablePrefix + "ProductAttributes", options.Schema); |
|||
b.ConfigureByConvention(); |
|||
/* Configure more properties here */ |
|||
}); |
|||
|
|||
builder.Entity<ProductAttributeOption>(b => |
|||
{ |
|||
b.ToTable(options.TablePrefix + "ProductAttributeOptions", options.Schema); |
|||
b.ConfigureByConvention(); |
|||
/* Configure more properties here */ |
|||
}); |
|||
|
|||
builder.Entity<ProductSku>(b => |
|||
{ |
|||
b.ToTable(options.TablePrefix + "ProductSkus", options.Schema); |
|||
b.ConfigureByConvention(); |
|||
/* Configure more properties here */ |
|||
}); |
|||
|
|||
builder.Entity<Category>(b => |
|||
{ |
|||
b.ToTable(options.TablePrefix + "Categories", options.Schema); |
|||
b.ConfigureByConvention(); |
|||
/* Configure more properties here */ |
|||
}); |
|||
|
|||
builder.Entity<ProductType>(b => |
|||
{ |
|||
b.ToTable(options.TablePrefix + "ProductTypes", options.Schema); |
|||
b.ConfigureByConvention(); |
|||
/* Configure more properties here */ |
|||
}); |
|||
|
|||
builder.Entity<ProductCategory>(b => |
|||
{ |
|||
b.ToTable(options.TablePrefix + "ProductCategories", options.Schema); |
|||
b.ConfigureByConvention(); |
|||
/* Configure more properties here */ |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
0
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EntityFrameworkCore/ProductsModelBuilderConfigurationOptions.cs → modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/EntityFrameworkCore/ProductsModelBuilderConfigurationOptions.cs
0
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EntityFrameworkCore/ProductsModelBuilderConfigurationOptions.cs → modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/EntityFrameworkCore/ProductsModelBuilderConfigurationOptions.cs
@ -0,0 +1,33 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Threading; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Products.EntityFrameworkCore; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
namespace EasyAbp.EShop.Products.ProductCategories |
|||
{ |
|||
public class ProductCategoryRepository : EfCoreRepository<ProductsDbContext, ProductCategory, Guid>, IProductCategoryRepository |
|||
{ |
|||
public ProductCategoryRepository(IDbContextProvider<ProductsDbContext> dbContextProvider) : base(dbContextProvider) |
|||
{ |
|||
} |
|||
|
|||
public async Task<IEnumerable<ProductCategory>> GetListByCategoryId(Guid categoryId, Guid? storeId, |
|||
CancellationToken cancellationToken = default) |
|||
{ |
|||
return await GetQueryable().Where(pc => pc.CategoryId == categoryId && pc.StoreId == storeId) |
|||
.ToListAsync(cancellationToken); |
|||
} |
|||
|
|||
public async Task<IEnumerable<ProductCategory>> GetListByProductId(Guid productId, Guid? storeId, |
|||
CancellationToken cancellationToken = default) |
|||
{ |
|||
return await GetQueryable().Where(pc => pc.ProductId == productId && pc.StoreId == storeId) |
|||
.ToListAsync(cancellationToken); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Products.EntityFrameworkCore; |
|||
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
namespace EasyAbp.EShop.Products.ProductTypes |
|||
{ |
|||
public class ProductTypeRepository : EfCoreRepository<ProductsDbContext, ProductType, Guid>, IProductTypeRepository |
|||
{ |
|||
public ProductTypeRepository(IDbContextProvider<ProductsDbContext> dbContextProvider) : base(dbContextProvider) |
|||
{ |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Products.EntityFrameworkCore; |
|||
using Volo.Abp.Domain.Repositories.EntityFrameworkCore; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
namespace EasyAbp.EShop.Products.Products |
|||
{ |
|||
public class ProductRepository : EfCoreRepository<ProductsDbContext, Product, Guid>, IProductRepository |
|||
{ |
|||
public ProductRepository(IDbContextProvider<ProductsDbContext> dbContextProvider) : base(dbContextProvider) |
|||
{ |
|||
} |
|||
} |
|||
} |
|||
@ -1,13 +0,0 @@ |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
namespace EasyAbp.EShop.Products.EntityFrameworkCore |
|||
{ |
|||
[ConnectionStringName(ProductsDbProperties.ConnectionStringName)] |
|||
public interface IProductsDbContext : IEfCoreDbContext |
|||
{ |
|||
/* Add DbSet for each Aggregate Root here. Example: |
|||
* DbSet<Question> Questions { get; } |
|||
*/ |
|||
} |
|||
} |
|||
@ -1,27 +0,0 @@ |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
namespace EasyAbp.EShop.Products.EntityFrameworkCore |
|||
{ |
|||
[ConnectionStringName(ProductsDbProperties.ConnectionStringName)] |
|||
public class ProductsDbContext : AbpDbContext<ProductsDbContext>, IProductsDbContext |
|||
{ |
|||
/* Add DbSet for each Aggregate Root here. Example: |
|||
* public DbSet<Question> Questions { get; set; } |
|||
*/ |
|||
|
|||
public ProductsDbContext(DbContextOptions<ProductsDbContext> options) |
|||
: base(options) |
|||
{ |
|||
|
|||
} |
|||
|
|||
protected override void OnModelCreating(ModelBuilder builder) |
|||
{ |
|||
base.OnModelCreating(builder); |
|||
|
|||
builder.ConfigureProducts(); |
|||
} |
|||
} |
|||
} |
|||
@ -1,43 +0,0 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp; |
|||
|
|||
namespace EasyAbp.EShop.Products.EntityFrameworkCore |
|||
{ |
|||
public static class ProductsDbContextModelCreatingExtensions |
|||
{ |
|||
public static void ConfigureProducts( |
|||
this ModelBuilder builder, |
|||
Action<ProductsModelBuilderConfigurationOptions> optionsAction = null) |
|||
{ |
|||
Check.NotNull(builder, nameof(builder)); |
|||
|
|||
var options = new ProductsModelBuilderConfigurationOptions( |
|||
ProductsDbProperties.DbTablePrefix, |
|||
ProductsDbProperties.DbSchema |
|||
); |
|||
|
|||
optionsAction?.Invoke(options); |
|||
|
|||
/* Configure all entities here. Example: |
|||
|
|||
builder.Entity<Question>(b => |
|||
{ |
|||
//Configure table & schema name
|
|||
b.ToTable(options.TablePrefix + "Questions", options.Schema); |
|||
|
|||
b.ConfigureByConvention(); |
|||
|
|||
//Properties
|
|||
b.Property(q => q.Title).IsRequired().HasMaxLength(QuestionConsts.MaxTitleLength); |
|||
|
|||
//Relations
|
|||
b.HasMany(question => question.Tags).WithOne().HasForeignKey(qt => qt.QuestionId); |
|||
|
|||
//Indexes
|
|||
b.HasIndex(q => q.CreationTime); |
|||
}); |
|||
*/ |
|||
} |
|||
} |
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue