├── Mall.Application.DomainEventSubscribers ├── Mall.Application.DomainEventSubscribers.csproj ├── Properties │ └── AssemblyInfo.cs └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── Mall.Application.Order.DomainEventSubscribers ├── Class1.cs ├── Mall.Application.Order.DomainEventSubscribers.csproj ├── Properties │ └── AssemblyInfo.cs └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── Mall.Application.Order ├── DTO │ ├── OrderItemRequest.cs │ └── OrderRequest.cs ├── IOrderService.cs ├── Mall.Application.Order.csproj ├── OrderService.cs ├── Properties │ └── AssemblyInfo.cs └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── Mall.Application.SellingPrice.DomainEventSubscribers ├── Mall.Application.SellingPrice.DomainEventSubscribers.csproj ├── Properties │ └── AssemblyInfo.cs └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── Mall.Application.SellingPrice ├── CalculateSalePriceService.cs ├── CouponService.cs ├── DTO │ ├── CalculatedCartDTO.cs │ ├── CalculatedCartItemDTO.cs │ ├── CalculatedFullGroupDTO.cs │ ├── CartItemRequest.cs │ ├── CartRequest.cs │ └── CouponDTO.cs ├── ICalculateSalePriceService.cs ├── ICouponService.cs ├── Mall.Application.SellingPrice.csproj ├── Mall.Application.SellingPrice.csproj.user ├── Mapper │ └── ValueObjectToDTO.cs ├── Properties │ └── AssemblyInfo.cs └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── Mall.Application ├── BuyService.cs ├── CartService.cs ├── CouponService.cs ├── DTO │ ├── CartDTO.cs │ ├── CartItemDTO.cs │ ├── CartItemGroupDTO.cs │ ├── CouponDTO.cs │ ├── DeliveryAddNewShippingAddressRequest.cs │ ├── DeliveryEditShippingAddressRequest.cs │ ├── ExpressDTO.cs │ ├── PaymentMethodDTO.cs │ ├── ShippingAddressDTO.cs │ ├── SumbitOrderRequest.cs │ └── WalletDTO.cs ├── DeliveryService.cs ├── IBuyService.cs ├── ICartService.cs ├── ICouponService.cs ├── IDeliveryService.cs ├── IPaymentService.cs ├── Mall.Application.csproj ├── PaymentService.cs ├── Properties │ └── AssemblyInfo.cs └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── Mall.Domain.Events ├── Mall.Domain.Events.csproj ├── Properties │ └── AssemblyInfo.cs └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── Mall.Domain.IRepositories ├── Mall.Domain.IRepositories.csproj ├── Properties │ └── AssemblyInfo.cs ├── bin │ └── Debug │ │ ├── Mall.Domain.IRepositories.dll │ │ └── Mall.Domain.IRepositories.pdb └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── Mall.Domain.IRepositories.csproj.FileListAbsolute.txt │ ├── Mall.Domain.IRepositories.dll │ ├── Mall.Domain.IRepositories.pdb │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── Mall.Domain.Order.DomainEventSubscribers ├── Mall.Domain.Order.DomainEventSubscribers.csproj ├── OrderCreatedSubscriberPaymentContext.cs ├── OrderCreatedSubscriberSellingPriceContext.cs ├── Properties │ └── AssemblyInfo.cs ├── bin │ └── Debug │ │ ├── Mall.Domain.Order.Events.dll │ │ └── Mall.Domain.Order.Events.pdb └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── Mall.Domain.Order.Events.csproj.FileListAbsolute.txt │ ├── Mall.Domain.Order.Events.dll │ ├── Mall.Domain.Order.Events.pdb │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── Mall.Domain.Order ├── Aggregate │ └── Order.cs ├── DomainEvent │ ├── DomainEventSubscriberConfiguration.cs │ └── Events │ │ └── OrderCreated.cs ├── DomainRegistry.cs ├── Entity │ └── OrderItem.cs ├── IRemoteServices │ └── ISellingPriceService.cs ├── IRepositories │ └── IOrderRepository.cs ├── Mall.Domain.Order.csproj ├── Properties │ └── AssemblyInfo.cs └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── Mall.Domain.SellingPrice.Events ├── Mall.Domain.SellingPrice.Events.csproj ├── Properties │ └── AssemblyInfo.cs └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── Mall.Domain.SellingPrice ├── Coupon │ └── Aggregate │ │ ├── Coupon.cs │ │ └── CouponNo.cs ├── DomainRegistry.cs ├── IRemoteServices │ └── IUserService.cs ├── IRepositories │ ├── ICouponNoRepository.cs │ ├── ICouponRepository.cs │ ├── IPromotionRepository.cs │ └── IRoleDiscountRelationRepository.cs ├── Mall.Domain.SellingPrice.csproj ├── Mall.Domain.SellingPrice.csproj.user ├── MemberPrice │ └── ValueObject │ │ ├── RoleDiscountRelation.cs │ │ └── UserRoleRelation.cs ├── Promotion │ ├── Aggregate │ │ ├── IMultiProdcutsReducePricePromotion.cs │ │ ├── IMultiProductsPromotion.cs │ │ ├── ISingleProductPromotion.cs │ │ ├── MultiProductPromotionRule.cs │ │ ├── PromotionRule.cs │ │ ├── PromotionRuleBuyMoreDiscount.cs │ │ ├── PromotionRuleBuyMoreSomeFree.cs │ │ ├── PromotionRuleLimitTimeDiscount.cs │ │ ├── PromotionRuleMeetReduction.cs │ │ └── SingleProductPromotionRule.cs │ └── ValueObject │ │ ├── BoughtProduct.cs │ │ └── PromotionContainsProduct.cs ├── Properties │ └── AssemblyInfo.cs └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── Mall.Domain ├── CartModule │ ├── Aggregate │ │ └── Cart.cs │ └── Entity │ │ └── CartItem.cs ├── DeliveryModule │ └── Aggregate │ │ └── Express.cs ├── DomainRegistry.cs ├── FavoritesModule │ ├── Aggregate │ │ └── Favorites.cs │ └── Entity │ │ └── FavoritesItem.cs ├── IRemoteServices │ ├── IOrderService.cs │ ├── IPaymentService.cs │ ├── IProductService.cs │ ├── ISellingPriceService.cs │ └── IUserService.cs ├── IRepositories │ ├── ICartRepository.cs │ ├── IExpressRepository.cs │ └── IFavoritesRepository.cs ├── Mall.Domain.csproj ├── Mall.Domain.csproj.user ├── Properties │ └── AssemblyInfo.cs ├── ValueObject │ ├── Coupon.cs │ ├── PaymentMethod.cs │ ├── Product.cs │ ├── SellingPriceCart.cs │ ├── SellingPriceCartItem.cs │ ├── SellingPriceFullGroup.cs │ ├── ShippingAddress.cs │ ├── User.cs │ ├── WaitCreateOrder.cs │ ├── WaitCreateOrderItem.cs │ └── Wallet.cs └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── Mall.DomainService.Order ├── Class1.cs ├── Mall.DomainService.Order.csproj ├── Properties │ └── AssemblyInfo.cs └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── Mall.DomainService.SellingPrice ├── Mall.DomainService.SellingPrice.csproj ├── Mall.DomainService.SellingPrice.csproj.user ├── MergeSingleProductPromotionForOneProductDomainService.cs ├── Properties │ └── AssemblyInfo.cs └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── Mall.DomainService ├── ConfirmUserCartExistedDomainService.cs ├── Mall.DomainService.csproj ├── Mall.DomainService.csproj.user ├── Properties │ └── AssemblyInfo.cs └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── Mall.Infrastructure.Order.Translators ├── Mall.Infrastructure.Order.Translators.csproj ├── Properties │ └── AssemblyInfo.cs ├── SellingPrice │ ├── SellingPriceAdapter.cs │ ├── SellingPriceService.cs │ └── SellingPriceTranslator.cs └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── Mall.Infrastructure.Repositories ├── CartSqlServerRepository.cs ├── CouponNoRepository.cs ├── CouponRepository.cs ├── ExpressSqlServerRepository.cs ├── FavoritesSqlServerRepository.cs ├── Mall.Infrastructure.Repositories.csproj ├── OrderSqlServerRepository.cs ├── PromotionSqlServerRepository.cs ├── Properties │ └── AssemblyInfo.cs ├── RoleDiscountRelationRepository.cs └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── Mall.Infrastructure.SellingPrice.Translators ├── Mall.Infrastructure.SellingPrice.Translators.csproj ├── Properties │ └── AssemblyInfo.cs ├── User │ ├── UserAdapter.cs │ ├── UserService.cs │ └── UserTranslator.cs └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── Mall.Infrastructure.Translators ├── Mall.Infrastructure.Translators.csproj ├── Order │ ├── OrderAdapter.cs │ ├── OrderService.cs │ └── OrderTranslator.cs ├── Payment │ ├── PaymentAdapter.cs │ ├── PaymentService.cs │ └── PaymentTranslator.cs ├── Product │ ├── ProductAdapter.cs │ ├── ProductService.cs │ └── ProductTranslator.cs ├── Properties │ └── AssemblyInfo.cs ├── SellingPrice │ ├── SellingPriceAdapter.cs │ ├── SellingPriceService.cs │ └── SellingPriceTranslator.cs ├── User │ ├── UserAdapter.cs │ ├── UserService.cs │ └── UserTranslator.cs └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── Mall.Infrastructure ├── DomainCore │ ├── AggregateRoot.cs │ ├── AloneStorableValueObject.cs │ ├── ConcurrencySafeAggregate.cs │ ├── ConcurrencySafeEntity.cs │ ├── DelegateIdentifier.cs │ ├── Entity.cs │ ├── IAloneStorable.cs │ ├── IRepository.cs │ ├── IUnitOfWork.cs │ ├── SqlServerUnitOfWork.cs │ ├── UnitOfWork.cs │ └── ValueObject.cs ├── DomainEventCore │ ├── DomainEvent.cs │ ├── DomainEventBus.cs │ ├── DomainEventSubscriber.cs │ ├── IDomainEvent.cs │ └── IDomainEventSubscriber.cs ├── Mall.Infrastructure.csproj ├── Properties │ └── AssemblyInfo.cs ├── ResponseHandle │ └── JsonResponseReader.cs ├── Results │ └── Result.cs └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── Mall.sln ├── Mall.sln.DotSettings.user ├── Mall.v12.suo ├── Mall ├── App_Start │ └── RouteConfig.cs ├── Global.asax ├── Global.asax.cs ├── Mall.csproj ├── Mall.csproj.user ├── Properties │ └── AssemblyInfo.cs ├── Views │ └── web.config ├── Web.Debug.config ├── Web.Release.config ├── Web.config ├── obj │ └── Debug │ │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs └── packages.config ├── README.md ├── TestResults └── 0573bd35-21b6-4f04-bcb2-81826ec3e28c │ └── Administrator_DESKTOP-UO0JAKG 2016-12-08 06_21_51.coverage ├── UnitTest.Mall.Domain.SellingPrice ├── Properties │ └── AssemblyInfo.cs ├── UnitTest.Mall.Domain.SellingPrice.csproj ├── UnitTest.Mall.Domain.SellingPrice.csproj.user ├── UnitTest_BoughtProduct.cs ├── UnitTest_MultiProductPromotionRule.cs ├── UnitTest_PromotionRuleBuyMoreDiscount.cs ├── UnitTest_PromotionRuleBuyMoreSomeFree.cs ├── UnitTest_PromotionRuleLimitTimeDiscount.cs ├── UnitTest_PromotionRuleMeetReduction.cs ├── UnitTest_RoleDiscountRelation.cs ├── UnitTest_SingleProductPromotionRule.cs └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs ├── UnitTest.Mall.Domain ├── CartItemTest.cs ├── CartTest.cs ├── FavoritesItemTest.cs ├── FavoritesTest.cs ├── Properties │ └── AssemblyInfo.cs ├── UnitTest.Mall.Domain.csproj └── obj │ └── Debug │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs │ ├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs │ └── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs └── packages ├── Microsoft.AspNet.Mvc.5.2.3 ├── Content │ ├── Web.config.install.xdt │ └── Web.config.uninstall.xdt ├── Microsoft.AspNet.Mvc.5.2.3.nupkg └── lib │ └── net45 │ ├── System.Web.Mvc.dll │ └── System.Web.Mvc.xml ├── Microsoft.AspNet.Razor.3.2.3 ├── Microsoft.AspNet.Razor.3.2.3.nupkg └── lib │ └── net45 │ ├── System.Web.Razor.dll │ └── System.Web.Razor.xml ├── Microsoft.AspNet.WebPages.3.2.3 ├── Content │ ├── Web.config.install.xdt │ └── Web.config.uninstall.xdt ├── Microsoft.AspNet.WebPages.3.2.3.nupkg └── lib │ └── net45 │ ├── System.Web.Helpers.dll │ ├── System.Web.Helpers.xml │ ├── System.Web.WebPages.Deployment.dll │ ├── System.Web.WebPages.Deployment.xml │ ├── System.Web.WebPages.Razor.dll │ ├── System.Web.WebPages.Razor.xml │ ├── System.Web.WebPages.dll │ └── System.Web.WebPages.xml ├── Microsoft.Web.Infrastructure.1.0.0.0 ├── Microsoft.Web.Infrastructure.1.0.0.0.nupkg └── lib │ └── net40 │ └── Microsoft.Web.Infrastructure.dll └── repositories.config /Mall.Application.DomainEventSubscribers/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mall.Application.DomainEventSubscribers")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Mall.Application.DomainEventSubscribers")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("c0949492-561a-43f8-9c94-a6409d8a1cf1")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Mall.Application.DomainEventSubscribers/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application.DomainEventSubscribers/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /Mall.Application.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /Mall.Application.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /Mall.Application.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /Mall.Application.Order.DomainEventSubscribers/Class1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Mall.Application.Order.DomainEventSubscribers 8 | { 9 | public class Class1 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Mall.Application.Order.DomainEventSubscribers/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mall.Application.Order.DomainEventSubscribers")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Mall.Application.Order.DomainEventSubscribers")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("f73be6e0-9756-40b1-81a0-c727e84bb81b")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Mall.Application.Order.DomainEventSubscribers/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application.Order.DomainEventSubscribers/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /Mall.Application.Order.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application.Order.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /Mall.Application.Order.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application.Order.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /Mall.Application.Order.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application.Order.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /Mall.Application.Order/DTO/OrderItemRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Application.Order.DTO 2 | { 3 | public class OrderItemRequest 4 | { 5 | public string ProductId { get; set; } 6 | 7 | public int Quantity { get; set; } 8 | 9 | public decimal UnitPrice { get; set; } 10 | 11 | public string JoinedMultiProductsPromotionId { get; set; } 12 | 13 | public string ProductName { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Mall.Application.Order/DTO/OrderRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Mall.Application.Order.DTO 4 | { 5 | public class OrderRequest 6 | { 7 | public string CartId { get; set; } 8 | 9 | public string UserId { get; set; } 10 | 11 | public string Receiver { get; set; } 12 | 13 | public string CountryId { get; set; } 14 | 15 | public string CountryName { get; set; } 16 | 17 | public string ProvinceId { get; set; } 18 | 19 | public string ProvinceName { get; set; } 20 | 21 | public string CityId { get; set; } 22 | 23 | public string CityName { get; set; } 24 | 25 | public string DistrictId { get; set; } 26 | 27 | public string DistrictName { get; set; } 28 | 29 | public string Address { get; set; } 30 | 31 | public string Mobile { get; set; } 32 | 33 | public string Phone { get; set; } 34 | 35 | public string Email { get; set; } 36 | 37 | public string PaymentMethodId { get; set; } 38 | 39 | public string PaymentMethodName { get; set; } 40 | 41 | public string ExpressId { get; set; } 42 | 43 | public string ExpressName { get; set; } 44 | 45 | public decimal Freight { get; set; } 46 | 47 | public string CouponId { get; set; } 48 | 49 | public string CouponName { get; set; } 50 | 51 | public decimal CouponValue { get; set; } 52 | 53 | public DateTime OrderTime { get; set; } 54 | 55 | public OrderItemRequest[] OrderItems { get; set; } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Mall.Application.Order/IOrderService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Mall.Application.Order.DTO; 7 | using Mall.Infrastructure.Results; 8 | 9 | namespace Mall.Application.Order 10 | { 11 | public interface IOrderService 12 | { 13 | Result Create(OrderRequest orderRequest); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Mall.Application.Order/OrderService.cs: -------------------------------------------------------------------------------- 1 | using Mall.Application.Order.DTO; 2 | using Mall.Domain.Order; 3 | using Mall.Domain.Order.DomainEvent.Events; 4 | using Mall.Infrastructure.DomainCore; 5 | using Mall.Infrastructure.DomainEventCore; 6 | using Mall.Infrastructure.Results; 7 | 8 | namespace Mall.Application.Order 9 | { 10 | public class OrderService : IOrderService 11 | { 12 | public Result Create(OrderRequest orderRequest) 13 | { 14 | if (!string.IsNullOrWhiteSpace(orderRequest.CouponId)) 15 | { 16 | var couponResult = DomainRegistry.SellingPriceService().IsCouponCanUse(orderRequest.CouponId, orderRequest.OrderTime); 17 | if (!couponResult.IsSuccess) 18 | return Result.Fail(couponResult.Msg); 19 | } 20 | 21 | var orderId = DomainRegistry.OrderRepository().NextIdentity(); 22 | var order = Domain.Order.Aggregate.Order.Create(orderId, orderRequest.UserId, orderRequest.Receiver, 23 | orderRequest.CountryId, orderRequest.CountryName, orderRequest.ProvinceId, orderRequest.ProvinceName, 24 | orderRequest.CityId, orderRequest.CityName, orderRequest.DistrictId, orderRequest.DistrictName, 25 | orderRequest.Address, orderRequest.Mobile, orderRequest.Phone, orderRequest.Email, 26 | orderRequest.PaymentMethodId, orderRequest.PaymentMethodName, orderRequest.ExpressId, 27 | orderRequest.ExpressName, orderRequest.Freight, orderRequest.CouponId, orderRequest.CouponName, orderRequest.CouponValue, orderRequest.OrderTime); 28 | 29 | foreach (var orderItemRequest in orderRequest.OrderItems) 30 | { 31 | order.AddOrderItem(orderItemRequest.ProductId, orderItemRequest.Quantity, orderItemRequest.UnitPrice, orderItemRequest.JoinedMultiProductsPromotionId, orderItemRequest.ProductName); 32 | } 33 | 34 | //DomainRegistry.OrderRepository().Save(order); 35 | IUnitOfWork unitOfWork = new SqlServerUnitOfWork(); 36 | unitOfWork.RegisterSaved(order); 37 | unitOfWork.Commit(); 38 | return Result.Success(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Mall.Application.Order/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mall.Application.Order")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Mall.Application.Order")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("35e4d23c-2859-4dde-a905-7b30ba8664e9")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Mall.Application.Order/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application.Order/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /Mall.Application.Order/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application.Order/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /Mall.Application.Order/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application.Order/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /Mall.Application.Order/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application.Order/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /Mall.Application.SellingPrice.DomainEventSubscribers/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mall.Application.SellingPrice.DomainEventSubscribers")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Mall.Application.SellingPrice.DomainEventSubscribers")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("3da06784-c287-4bd1-8021-8473172d7c1f")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Mall.Application.SellingPrice.DomainEventSubscribers/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application.SellingPrice.DomainEventSubscribers/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /Mall.Application.SellingPrice.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application.SellingPrice.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /Mall.Application.SellingPrice.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application.SellingPrice.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /Mall.Application.SellingPrice.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application.SellingPrice.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /Mall.Application.SellingPrice/DTO/CalculatedCartDTO.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Application.SellingPrice.DTO 2 | { 3 | public class CalculatedCartDTO 4 | { 5 | public string CartId { get; set; } 6 | 7 | public CalculatedFullGroupDTO[] CalculatedFullGroups { get; set; } 8 | 9 | public CalculatedCartItemDTO[] CalculatedCartItems { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Mall.Application.SellingPrice/DTO/CalculatedCartItemDTO.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Application.SellingPrice.DTO 2 | { 3 | public class CalculatedCartItemDTO 4 | { 5 | public string ProductId { get; set; } 6 | 7 | public decimal ReducePrice { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Mall.Application.SellingPrice/DTO/CalculatedFullGroupDTO.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Application.SellingPrice.DTO 2 | { 3 | public class CalculatedFullGroupDTO 4 | { 5 | public CalculatedCartItemDTO[] CalculatedCartItems { get; set; } 6 | 7 | public decimal ReducePrice { get; set; } 8 | 9 | public string MultiProductsPromotionId { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Mall.Application.SellingPrice/DTO/CartItemRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Application.SellingPrice.DTO 2 | { 3 | public class CartItemRequest 4 | { 5 | public string ProductId { get; set; } 6 | 7 | public int Quantity { get; set; } 8 | 9 | public decimal UnitPrice { get; set; } 10 | 11 | public string SelectedMultiProductsPromotionId { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Mall.Application.SellingPrice/DTO/CartRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Application.SellingPrice.DTO 2 | { 3 | public class CartRequest 4 | { 5 | public string CartId { get; set; } 6 | 7 | public string UserId { get; set; } 8 | 9 | public CartItemRequest[] CartItems { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Mall.Application.SellingPrice/DTO/CouponDTO.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Mall.Application.SellingPrice.DTO 8 | { 9 | public class CouponDTO 10 | { 11 | public string ID { get; set; } 12 | 13 | public string Name { get; set; } 14 | 15 | public bool CanUse { get; set; } 16 | 17 | public decimal Value { get; set; } 18 | 19 | public DateTime ExpiryDate { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Mall.Application.SellingPrice/ICalculateSalePriceService.cs: -------------------------------------------------------------------------------- 1 | using Mall.Application.SellingPrice.DTO; 2 | 3 | namespace Mall.Application.SellingPrice 4 | { 5 | public interface ICalculateSalePriceService 6 | { 7 | CalculatedCartDTO Calculate(CartRequest cart); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Mall.Application.SellingPrice/ICouponService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Mall.Application.SellingPrice.DTO; 4 | using Mall.Infrastructure.Results; 5 | 6 | namespace Mall.Application.SellingPrice 7 | { 8 | public interface ICouponService 9 | { 10 | List Calculate(CartRequest cart); 11 | 12 | Result IsCouponCanUse(string id, DateTime orderTime); 13 | 14 | CouponDTO GetCoupon(string id); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Mall.Application.SellingPrice/Mall.Application.SellingPrice.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ShowAllFiles 5 | 6 | -------------------------------------------------------------------------------- /Mall.Application.SellingPrice/Mapper/ValueObjectToDTO.cs: -------------------------------------------------------------------------------- 1 | using Mall.Application.SellingPrice.DTO; 2 | using Mall.Domain.SellingPrice.Promotion.ValueObject; 3 | 4 | namespace Mall.Application.SellingPrice.Mapper 5 | { 6 | public static class ValueObjectToDTO 7 | { 8 | public static CalculatedCartItemDTO ToDTO(this BoughtProduct boughtProduct) 9 | { 10 | return new CalculatedCartItemDTO 11 | { 12 | ProductId = boughtProduct.ProductId, 13 | ReducePrice = boughtProduct.ReducePrice 14 | }; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Mall.Application.SellingPrice/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mall.Application.SellingPrice")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Mall.Application.SellingPrice")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("c91d057e-fc76-4aff-9c42-d60512f143e8")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Mall.Application.SellingPrice/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application.SellingPrice/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /Mall.Application.SellingPrice/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application.SellingPrice/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /Mall.Application.SellingPrice/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application.SellingPrice/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /Mall.Application.SellingPrice/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application.SellingPrice/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /Mall.Application/BuyService.cs: -------------------------------------------------------------------------------- 1 | using Mall.Domain; 2 | using Mall.DomainService; 3 | using Mall.Infrastructure.Results; 4 | 5 | namespace Mall.Application 6 | { 7 | public class BuyService : IBuyService 8 | { 9 | private readonly static ConfirmUserCartExistedDomainService _confirmUserCartExistedDomainService = new ConfirmUserCartExistedDomainService(); 10 | 11 | public Result Buy(string userId, string productId, int quantity) 12 | { 13 | var product = DomainRegistry.ProductService().GetProduct(productId); 14 | if (product == null) 15 | { 16 | return Result.Fail("对不起,未能获取产品信息请重试~"); 17 | } 18 | 19 | var cart = _confirmUserCartExistedDomainService.GetUserCart(userId); 20 | cart.AddCartItem(product, quantity); 21 | DomainRegistry.CartRepository().Save(cart); 22 | return Result.Success(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Mall.Application/CouponService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using Mall.Application.DTO; 4 | using Mall.Domain; 5 | using Mall.DomainService; 6 | 7 | namespace Mall.Application 8 | { 9 | public class CouponService : ICouponService 10 | { 11 | private readonly static ConfirmUserCartExistedDomainService _confirmUserCartExistedDomainService = new ConfirmUserCartExistedDomainService(); 12 | 13 | public List GetAllCoupons(string userId) 14 | { 15 | var cart = _confirmUserCartExistedDomainService.GetUserCart(userId); 16 | 17 | if (cart.IsEmpty()) 18 | { 19 | return null; 20 | } 21 | 22 | var coupons = DomainRegistry.SellingPriceService().CalculateAllCoupons(cart); 23 | return coupons.Select(ent => new CouponDTO 24 | { 25 | CanUse = ent.CanUse, 26 | ExpiryDate = ent.ExpiryDate, 27 | ID = ent.ID, 28 | Name = ent.Name, 29 | Value = ent.Value 30 | }).ToList(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Mall.Application/DTO/CartDTO.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | 3 | namespace Mall.Application.DTO 4 | { 5 | public class CartDTO 6 | { 7 | /// 8 | /// 有参与满类型活动的购物项组的集合 9 | /// 10 | public CartItemGroupDTO[] CartItemGroups { get; set; } 11 | 12 | /// 13 | /// 没有参与满类型活动的购物项集合 14 | /// 15 | public CartItemDTO[] CartItems { get; set; } 16 | 17 | /// 18 | /// 总销售价(优惠前的价格) 19 | /// 20 | public decimal TotalSalePrice 21 | { 22 | get 23 | { 24 | if (CartItems.Length == 0 && CartItemGroups.Length == 0) 25 | return 0; 26 | 27 | return CartItems.Sum(ent => ent.SalePrice) + CartItemGroups.Sum(ent => ent.CartItems.Sum(e => e.SalePrice)); 28 | } 29 | } 30 | 31 | /// 32 | /// 总折扣金额 33 | /// 34 | public decimal TotalReducePrice 35 | { 36 | get 37 | { 38 | if (CartItems.Length == 0 && CartItemGroups.Length == 0) 39 | return 0; 40 | 41 | return CartItems.Sum(ent => ent.ReducePrice) + CartItemGroups.Sum(ent => ent.CartItems.Sum(e => e.ReducePrice)) + CartItemGroups.Sum(ent => ent.ReducePrice); 42 | } 43 | } 44 | 45 | /// 46 | /// 总实际售价 47 | /// 48 | public decimal TotalRealPrice 49 | { 50 | get 51 | { 52 | return TotalSalePrice - TotalReducePrice; 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Mall.Application/DTO/CartItemDTO.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Application.DTO 2 | { 3 | public class CartItemDTO 4 | { 5 | public string ProductId { get; set; } 6 | 7 | public string ProductName { get; set; } 8 | 9 | /// 10 | /// 普通销售价 11 | /// 12 | public decimal SalePrice { get; set; } 13 | 14 | /// 15 | /// 折扣金额 16 | /// 17 | public decimal ReducePrice { get; set; } 18 | 19 | /// 20 | /// 实际价格 21 | /// 22 | public decimal RealPrice 23 | { 24 | get { return SalePrice - ReducePrice; } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Mall.Application/DTO/CartItemGroupDTO.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Application.DTO 2 | { 3 | public class CartItemGroupDTO 4 | { 5 | public CartItemDTO[] CartItems { get; set; } 6 | 7 | public decimal ReducePrice { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Mall.Application/DTO/CouponDTO.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Mall.Application.DTO 4 | { 5 | public class CouponDTO 6 | { 7 | public string ID { get; set; } 8 | 9 | public string Name { get; set; } 10 | 11 | public bool CanUse { get; set; } 12 | 13 | public decimal Value { get; set; } 14 | 15 | public DateTime ExpiryDate { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Mall.Application/DTO/DeliveryAddNewShippingAddressRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Application.DTO 2 | { 3 | public class DeliveryAddNewShippingAddressRequest 4 | { 5 | public string Receiver { get; private set; } 6 | 7 | public string CountryId { get; private set; } 8 | 9 | public string CountryName { get; private set; } 10 | 11 | public string ProvinceId { get; private set; } 12 | 13 | public string ProvinceName { get; private set; } 14 | 15 | public string CityId { get; private set; } 16 | 17 | public string CityName { get; private set; } 18 | 19 | public string DistrictId { get; private set; } 20 | 21 | public string DistrictName { get; private set; } 22 | 23 | public string Address { get; private set; } 24 | 25 | public string Mobile { get; private set; } 26 | 27 | public string Phone { get; private set; } 28 | 29 | public string Email { get; private set; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Mall.Application/DTO/DeliveryEditShippingAddressRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Application.DTO 2 | { 3 | public class DeliveryEditShippingAddressRequest : DeliveryAddNewShippingAddressRequest 4 | { 5 | public string ShippingAddressId { get; private set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Mall.Application/DTO/ExpressDTO.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Application.DTO 2 | { 3 | public class ExpressDTO 4 | { 5 | public string ID { get; set; } 6 | 7 | public string Name { get; set; } 8 | 9 | public decimal Freight { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Mall.Application/DTO/PaymentMethodDTO.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Mall.Application.DTO 8 | { 9 | public class PaymentMethodDTO 10 | { 11 | public string ID { get; set; } 12 | 13 | public string Name { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Mall.Application/DTO/ShippingAddressDTO.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Application.DTO 2 | { 3 | public class ShippingAddressDTO 4 | { 5 | public string ShippingAddressId { get; set; } 6 | 7 | public string Receiver { get; set; } 8 | 9 | public string CountryId { get; set; } 10 | 11 | public string CountryName { get; set; } 12 | 13 | public string ProvinceId { get; set; } 14 | 15 | public string ProvinceName { get; set; } 16 | 17 | public string CityId { get; set; } 18 | 19 | public string CityName { get; set; } 20 | 21 | public string DistrictId { get; set; } 22 | 23 | public string DistrictName { get; set; } 24 | 25 | public string Address { get; set; } 26 | 27 | public string Mobile { get; set; } 28 | 29 | public string Phone { get; set; } 30 | 31 | public string Email { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Mall.Application/DTO/SumbitOrderRequest.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Application.DTO 2 | { 3 | public class SumbitOrderRequest 4 | { 5 | public string UserId { get; set; } 6 | 7 | public string ShippingAddressId { get; set; } 8 | 9 | public string PaymentMethodId { get; set; } 10 | 11 | public string ExpressId { get; set; } 12 | 13 | public string CouponId { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Mall.Application/DTO/WalletDTO.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Application.DTO 2 | { 3 | public class WalletDTO 4 | { 5 | public decimal AvailableBalance { get; set; } 6 | 7 | public int AvailableScore { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Mall.Application/IBuyService.cs: -------------------------------------------------------------------------------- 1 | using Mall.Application.DTO; 2 | using Mall.Infrastructure.Results; 3 | 4 | namespace Mall.Application 5 | { 6 | public interface IBuyService 7 | { 8 | Result Buy(string userId, string productId, int quantity); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Mall.Application/ICartService.cs: -------------------------------------------------------------------------------- 1 | using Mall.Application.DTO; 2 | using Mall.Infrastructure.Results; 3 | 4 | namespace Mall.Application 5 | { 6 | public interface ICartService 7 | { 8 | CartDTO GetCart(string userId); 9 | 10 | Result ChangeQuantity(string userId, string id, int quantity); 11 | 12 | Result DeleteCartItem(string userId, string id); 13 | 14 | Result AddToFavorites(string userId, string productId); 15 | 16 | Result ChangeMultiProductsPromotion(string userId, string productId, string selectedMultiProductsPromotionId); 17 | 18 | Result SubmitOrder(SumbitOrderRequest request); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Mall.Application/ICouponService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Mall.Application.DTO; 3 | 4 | namespace Mall.Application 5 | { 6 | public interface ICouponService 7 | { 8 | List GetAllCoupons(string userId); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Mall.Application/IDeliveryService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Mall.Application.DTO; 3 | using Mall.Infrastructure.Results; 4 | 5 | namespace Mall.Application 6 | { 7 | public interface IDeliveryService 8 | { 9 | List GetAllShippingAddresses(string userId); 10 | 11 | Result AddNewShippingAddress(string userId, DeliveryAddNewShippingAddressRequest request); 12 | 13 | Result EditShippingAddress(string userId, DeliveryEditShippingAddressRequest request); 14 | 15 | Result DeleteShippingAddress(string id); 16 | 17 | List GetAllCanUseExpresses(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Mall.Application/IPaymentService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Mall.Application.DTO; 3 | 4 | namespace Mall.Application 5 | { 6 | public interface IPaymentService 7 | { 8 | List GetAllCanUsePaymentMethods(); 9 | 10 | WalletDTO GetUserWallet(string userId); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Mall.Application/PaymentService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using Mall.Application.DTO; 4 | using Mall.Domain; 5 | 6 | namespace Mall.Application 7 | { 8 | public class PaymentService : IPaymentService 9 | { 10 | public List GetAllCanUsePaymentMethods() 11 | { 12 | var paymentMethods = DomainRegistry.PaymentService().GetAllPaymentMethods(); 13 | return paymentMethods.Select(ent => new PaymentMethodDTO 14 | { 15 | ID = ent.ID, 16 | Name = ent.Name 17 | }).ToList(); 18 | } 19 | 20 | public WalletDTO GetUserWallet(string userId) 21 | { 22 | var wallet = DomainRegistry.PaymentService().GetWalletByUserId(userId); 23 | return new WalletDTO 24 | { 25 | AvailableBalance = wallet.AvailableBalance, 26 | AvailableScore = wallet.AvailableScore 27 | }; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Mall.Application/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mall.Application")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Mall.Application")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("c547965f-399c-4b91-a16f-5dce97b83509")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Mall.Application/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /Mall.Application/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /Mall.Application/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /Mall.Application/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Application/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /Mall.Domain.Events/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mall.Domain.Events")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Mall.Domain.Events")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("dedf8788-7131-40bb-8820-968caadfe621")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Mall.Domain.Events/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.Events/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /Mall.Domain.Events/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.Events/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /Mall.Domain.Events/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.Events/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /Mall.Domain.Events/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.Events/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /Mall.Domain.IRepositories/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mall.Domain.IRepositories")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Mall.Domain.IRepositories")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d7654734-7b78-4c15-8657-143d95b4fa3c")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Mall.Domain.IRepositories/bin/Debug/Mall.Domain.IRepositories.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.IRepositories/bin/Debug/Mall.Domain.IRepositories.dll -------------------------------------------------------------------------------- /Mall.Domain.IRepositories/bin/Debug/Mall.Domain.IRepositories.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.IRepositories/bin/Debug/Mall.Domain.IRepositories.pdb -------------------------------------------------------------------------------- /Mall.Domain.IRepositories/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.IRepositories/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /Mall.Domain.IRepositories/obj/Debug/Mall.Domain.IRepositories.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Workspaces\Demo\DDDDemo\Mall.Domain.IRepositories\bin\Debug\Mall.Domain.IRepositories.dll 2 | C:\Workspaces\Demo\DDDDemo\Mall.Domain.IRepositories\bin\Debug\Mall.Domain.IRepositories.pdb 3 | C:\Workspaces\Demo\DDDDemo\Mall.Domain.IRepositories\obj\Debug\Mall.Domain.IRepositories.dll 4 | C:\Workspaces\Demo\DDDDemo\Mall.Domain.IRepositories\obj\Debug\Mall.Domain.IRepositories.pdb 5 | -------------------------------------------------------------------------------- /Mall.Domain.IRepositories/obj/Debug/Mall.Domain.IRepositories.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.IRepositories/obj/Debug/Mall.Domain.IRepositories.dll -------------------------------------------------------------------------------- /Mall.Domain.IRepositories/obj/Debug/Mall.Domain.IRepositories.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.IRepositories/obj/Debug/Mall.Domain.IRepositories.pdb -------------------------------------------------------------------------------- /Mall.Domain.IRepositories/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.IRepositories/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /Mall.Domain.IRepositories/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.IRepositories/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /Mall.Domain.IRepositories/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.IRepositories/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /Mall.Domain.Order.DomainEventSubscribers/OrderCreatedSubscriberPaymentContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mall.Domain.Order.DomainEvent.Events; 3 | using Mall.Infrastructure.DomainEventCore; 4 | 5 | namespace Mall.Domain.Order.DomainEventSubscribers 6 | { 7 | public class OrderCreatedSubscriberPaymentContext : DomainEventSubscriber 8 | { 9 | public override void HandleEvent(OrderCreated domainEvent) 10 | { 11 | //TODO anything 12 | 13 | throw new NotImplementedException(); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Mall.Domain.Order.DomainEventSubscribers/OrderCreatedSubscriberSellingPriceContext.cs: -------------------------------------------------------------------------------- 1 | using Mall.Domain.Order.DomainEvent.Events; 2 | using Mall.Infrastructure.DomainEventCore; 3 | 4 | namespace Mall.Domain.Order.DomainEventSubscribers 5 | { 6 | public class OrderCreatedSubscriberSellingPriceContext : DomainEventSubscriber 7 | { 8 | public override void HandleEvent(OrderCreated domainEvent) 9 | { 10 | //TODO anything 11 | throw new System.NotImplementedException(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Mall.Domain.Order.DomainEventSubscribers/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mall.Domain.Order.Events")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Mall.Domain.Order.Events")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("62e0ad9c-c30d-45c4-9719-ddc23e6a1b7a")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Mall.Domain.Order.DomainEventSubscribers/bin/Debug/Mall.Domain.Order.Events.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.Order.DomainEventSubscribers/bin/Debug/Mall.Domain.Order.Events.dll -------------------------------------------------------------------------------- /Mall.Domain.Order.DomainEventSubscribers/bin/Debug/Mall.Domain.Order.Events.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.Order.DomainEventSubscribers/bin/Debug/Mall.Domain.Order.Events.pdb -------------------------------------------------------------------------------- /Mall.Domain.Order.DomainEventSubscribers/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.Order.DomainEventSubscribers/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /Mall.Domain.Order.DomainEventSubscribers/obj/Debug/Mall.Domain.Order.Events.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Workspaces\Demo\DDDDemo\Mall.Domain.Order.Events\bin\Debug\Mall.Domain.Order.Events.dll 2 | C:\Workspaces\Demo\DDDDemo\Mall.Domain.Order.Events\bin\Debug\Mall.Domain.Order.Events.pdb 3 | C:\Workspaces\Demo\DDDDemo\Mall.Domain.Order.Events\obj\Debug\Mall.Domain.Order.Events.dll 4 | C:\Workspaces\Demo\DDDDemo\Mall.Domain.Order.Events\obj\Debug\Mall.Domain.Order.Events.pdb 5 | -------------------------------------------------------------------------------- /Mall.Domain.Order.DomainEventSubscribers/obj/Debug/Mall.Domain.Order.Events.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.Order.DomainEventSubscribers/obj/Debug/Mall.Domain.Order.Events.dll -------------------------------------------------------------------------------- /Mall.Domain.Order.DomainEventSubscribers/obj/Debug/Mall.Domain.Order.Events.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.Order.DomainEventSubscribers/obj/Debug/Mall.Domain.Order.Events.pdb -------------------------------------------------------------------------------- /Mall.Domain.Order.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.Order.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /Mall.Domain.Order.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.Order.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /Mall.Domain.Order.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.Order.DomainEventSubscribers/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /Mall.Domain.Order/DomainEvent/DomainEventSubscriberConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Reflection; 4 | using Mall.Infrastructure.DomainEventCore; 5 | 6 | namespace Mall.Domain.Order.DomainEvent 7 | { 8 | public class DomainEventSubscriberConfiguration 9 | { 10 | public static void Initialize() 11 | { 12 | var types = Assembly.Load("Mall.Domain.Order.DomainEventSubscribers").GetTypes().Where(ent => !ent.IsGenericType && ent.GetInterface(typeof(IDomainEventSubscriber).FullName) != null).ToList(); 13 | foreach (var type in types) 14 | { 15 | var subscriberInstance = Activator.CreateInstance(AppDomain.CurrentDomain, type.Assembly.FullName, type.FullName).Unwrap(); 16 | var subscriber = (IDomainEventSubscriber)subscriberInstance; 17 | DomainEventBus.Instance().Subscribe(subscriber); 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Mall.Domain.Order/DomainEvent/Events/OrderCreated.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Domain.Order.DomainEvent.Events 2 | { 3 | public class OrderCreated : Infrastructure.DomainEventCore.DomainEvent 4 | { 5 | public string OrderId { get; private set; } 6 | 7 | public string UserId { get; private set; } 8 | 9 | public string Receiver { get; private set; } 10 | 11 | public OrderCreated(string orderId, string userId, string receiver) 12 | { 13 | this.OrderId = orderId; 14 | this.UserId = userId; 15 | this.Receiver = receiver; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Mall.Domain.Order/DomainRegistry.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mall.Domain.Order.IRemoteServices; 3 | using Mall.Domain.Order.IRepositories; 4 | 5 | namespace Mall.Domain.Order 6 | { 7 | public class DomainRegistry 8 | { 9 | private static IOrderRepository _orderRepository; 10 | private static ISellingPriceService _sellingPriceService; 11 | 12 | public static void RegisterOrderRepository(IOrderRepository orderRepository) 13 | { 14 | if (orderRepository == null) 15 | throw new ArgumentNullException("orderRepository"); 16 | _orderRepository = orderRepository; 17 | } 18 | 19 | public static void RegisterSellingPriceService(ISellingPriceService sellingPriceService) 20 | { 21 | if (sellingPriceService == null) 22 | throw new ArgumentNullException("sellingPriceService"); 23 | _sellingPriceService = sellingPriceService; 24 | } 25 | 26 | public static IOrderRepository OrderRepository() 27 | { 28 | return _orderRepository; 29 | } 30 | 31 | public static ISellingPriceService SellingPriceService() 32 | { 33 | return _sellingPriceService; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Mall.Domain.Order/Entity/OrderItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Mall.Domain.Order.Entity 4 | { 5 | public class OrderItem : Infrastructure.DomainCore.Entity 6 | { 7 | public int Quantity { get; private set; } 8 | 9 | public decimal UnitPrice { get; private set; } 10 | 11 | public string JoinedMultiProductsPromotionId { get; private set; } 12 | 13 | public string ProductName { get; private set; } 14 | 15 | internal OrderItem(string productId, int quantity, decimal unitPrice, string joinedMultiProductsPromotionId, string productName) 16 | { 17 | if (string.IsNullOrWhiteSpace(productId)) 18 | throw new ArgumentException("productId 不能为空", "productId"); 19 | 20 | if (quantity <= 0) 21 | throw new ArgumentException("quantity不能小于等于0", "quantity"); 22 | 23 | if (unitPrice < 0) 24 | throw new ArgumentException("unitPrice不能小于0", "unitPrice"); 25 | 26 | if (string.IsNullOrWhiteSpace(productName)) 27 | throw new ArgumentException("productName 不能为空", "productName"); 28 | 29 | this.ID = productId; 30 | this.Quantity = quantity; 31 | this.UnitPrice = unitPrice; 32 | this.JoinedMultiProductsPromotionId = joinedMultiProductsPromotionId; 33 | this.ProductName = productName; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Mall.Domain.Order/IRemoteServices/ISellingPriceService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mall.Infrastructure.Results; 3 | 4 | namespace Mall.Domain.Order.IRemoteServices 5 | { 6 | public interface ISellingPriceService 7 | { 8 | Result IsCouponCanUse(string id, DateTime orderTime); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Mall.Domain.Order/IRepositories/IOrderRepository.cs: -------------------------------------------------------------------------------- 1 | using Mall.Infrastructure.DomainCore; 2 | 3 | namespace Mall.Domain.Order.IRepositories 4 | { 5 | public interface IOrderRepository : IRepository 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Mall.Domain.Order/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mall.Domain.Order")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Mall.Domain.Order")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("6dd412f4-8912-421c-8476-5e0c46e03568")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Mall.Domain.Order/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.Order/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /Mall.Domain.Order/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.Order/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /Mall.Domain.Order/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.Order/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /Mall.Domain.Order/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.Order/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice.Events/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mall.Domain.SellingPrice.Events")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Mall.Domain.SellingPrice.Events")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("8c16eac1-d451-40f9-b7b2-6543317a1fe0")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice.Events/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.SellingPrice.Events/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice.Events/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.SellingPrice.Events/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice.Events/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.SellingPrice.Events/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice.Events/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.SellingPrice.Events/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/Coupon/Aggregate/Coupon.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Mall.Infrastructure.DomainCore; 5 | 6 | namespace Mall.Domain.SellingPrice.Coupon.Aggregate 7 | { 8 | public class Coupon : AggregateRoot 9 | { 10 | public string Name { get; private set; } 11 | 12 | public decimal Value { get; private set; } 13 | 14 | public DateTime ExpiryDate { get; private set; } 15 | 16 | public List ContainsProductIds { get; private set; } 17 | 18 | public Coupon(string name, decimal value, DateTime expiryDate, IEnumerable containsProductIds) 19 | { 20 | if (string.IsNullOrWhiteSpace(name)) 21 | throw new ArgumentNullException("name"); 22 | 23 | if (value <= 0) 24 | throw new ArgumentException("value不能小于等于0", "value"); 25 | 26 | if (expiryDate == default(DateTime)) 27 | throw new ArgumentException("请传入正确的expiryDate", "expiryDate"); 28 | 29 | if (containsProductIds == null) 30 | throw new ArgumentNullException("containsProductIds"); 31 | 32 | this.Name = name; 33 | this.Value = value; 34 | this.ExpiryDate = expiryDate; 35 | this.ContainsProductIds = containsProductIds.ToList(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/Coupon/Aggregate/CouponNo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mall.Infrastructure.DomainCore; 3 | 4 | namespace Mall.Domain.SellingPrice.Coupon.Aggregate 5 | { 6 | public class CouponNo : AggregateRoot 7 | { 8 | public string CouponId { get; private set; } 9 | 10 | public DateTime UsedTime { get; private set; } 11 | 12 | public bool IsUsed 13 | { 14 | get { return UsedTime != default(DateTime) && UsedTime < DateTime.Now; } 15 | } 16 | 17 | public string UserId { get; private set; } 18 | 19 | public CouponNo(string couponNo, string couponId, DateTime usedTime, string userId) 20 | { 21 | if (string.IsNullOrWhiteSpace(couponNo)) 22 | throw new ArgumentNullException("couponNo"); 23 | 24 | if (string.IsNullOrWhiteSpace(couponId)) 25 | throw new ArgumentNullException("couponId"); 26 | 27 | if (string.IsNullOrWhiteSpace(userId)) 28 | throw new ArgumentNullException("userId"); 29 | 30 | this.ID = couponNo; 31 | this.CouponId = couponId; 32 | this.UsedTime = usedTime; 33 | this.UserId = userId; 34 | } 35 | 36 | public void BeUsed() 37 | { 38 | this.UsedTime = DateTime.Now; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/IRemoteServices/IUserService.cs: -------------------------------------------------------------------------------- 1 | using Mall.Domain.SellingPrice.MemberPrice.ValueObject; 2 | 3 | namespace Mall.Domain.SellingPrice.IRemoteServices 4 | { 5 | public interface IUserService 6 | { 7 | UserRoleRelation GetUserRoleRelation(string userId); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/IRepositories/ICouponNoRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Mall.Domain.SellingPrice.Coupon.Aggregate; 3 | using Mall.Infrastructure.DomainCore; 4 | 5 | namespace Mall.Domain.SellingPrice.IRepositories 6 | { 7 | public interface ICouponNoRepository : IRepository 8 | { 9 | List GetNotUsedByUserId(string userId); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/IRepositories/ICouponRepository.cs: -------------------------------------------------------------------------------- 1 | using Mall.Infrastructure.DomainCore; 2 | 3 | namespace Mall.Domain.SellingPrice.IRepositories 4 | { 5 | public interface ICouponRepository : IRepository 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/IRepositories/IPromotionRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Mall.Domain.SellingPrice.Promotion.Aggregate; 3 | using Mall.Infrastructure.DomainCore; 4 | 5 | namespace Mall.Domain.SellingPrice.IRepositories 6 | { 7 | public interface IPromotionRepository : IRepository 8 | { 9 | IList GetListByContainsProductId(string productId); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/IRepositories/IRoleDiscountRelationRepository.cs: -------------------------------------------------------------------------------- 1 | using Mall.Domain.SellingPrice.MemberPrice.ValueObject; 2 | using Mall.Infrastructure.DomainCore; 3 | 4 | namespace Mall.Domain.SellingPrice.IRepositories 5 | { 6 | public interface IRoleDiscountRelationRepository : IRepository 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/Mall.Domain.SellingPrice.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ShowAllFiles 5 | 6 | -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/MemberPrice/ValueObject/RoleDiscountRelation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Mall.Domain.SellingPrice.MemberPrice.ValueObject 4 | { 5 | public class RoleDiscountRelation : Infrastructure.DomainCore.AloneStorableValueObject 6 | { 7 | public string RoleId { get; private set; } 8 | 9 | public string RoleName { get; private set; } 10 | 11 | public float DiscountRate { get; private set; } 12 | 13 | public RoleDiscountRelation(string roleId, string roleName, float discountRate) 14 | { 15 | if (string.IsNullOrWhiteSpace(roleId)) 16 | throw new ArgumentNullException("roleId"); 17 | 18 | if (string.IsNullOrWhiteSpace(roleName)) 19 | throw new ArgumentNullException("roleName"); 20 | 21 | if (discountRate < 0) 22 | throw new ArgumentException("discountRate"); 23 | 24 | this.RoleId = roleId; 25 | this.RoleName = roleName; 26 | this.DiscountRate = discountRate; 27 | } 28 | 29 | public decimal CalculateDiscountedPrice(decimal price) 30 | { 31 | return price - price * Convert.ToDecimal(this.DiscountRate); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/MemberPrice/ValueObject/UserRoleRelation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Mall.Domain.SellingPrice.MemberPrice.ValueObject 4 | { 5 | public class UserRoleRelation : Infrastructure.DomainCore.ValueObject 6 | { 7 | public string UserId { get; private set; } 8 | 9 | public string RoleId { get; private set; } 10 | 11 | public UserRoleRelation(string userId, string roleId) 12 | { 13 | if (string.IsNullOrWhiteSpace(userId)) 14 | throw new ArgumentNullException("userId"); 15 | 16 | if (string.IsNullOrWhiteSpace(roleId)) 17 | throw new ArgumentNullException("roleId"); 18 | 19 | this.UserId = userId; 20 | this.RoleId = roleId; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/Promotion/Aggregate/IMultiProdcutsReducePricePromotion.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Mall.Domain.SellingPrice.Promotion.ValueObject; 3 | 4 | namespace Mall.Domain.SellingPrice.Promotion.Aggregate 5 | { 6 | public interface IMultiProdcutsReducePricePromotion 7 | { 8 | decimal CalculateReducePrice(IEnumerable boughtProducts); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/Promotion/Aggregate/IMultiProductsPromotion.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | using Mall.Domain.SellingPrice.Promotion.ValueObject; 3 | 4 | namespace Mall.Domain.SellingPrice.Promotion.Aggregate 5 | { 6 | /// 7 | /// 多产品活动 8 | /// 9 | public interface IMultiProductsPromotion 10 | { 11 | ReadOnlyCollection GetPromotionContainsProducts(); 12 | 13 | void JoinProduct(string productId, string productName); 14 | 15 | void RemoveProduct(string productId); 16 | 17 | bool IsExistedProduct(string productId); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/Promotion/Aggregate/ISingleProductPromotion.cs: -------------------------------------------------------------------------------- 1 | using Mall.Domain.SellingPrice.Promotion.ValueObject; 2 | 3 | namespace Mall.Domain.SellingPrice.Promotion.Aggregate 4 | { 5 | /// 6 | /// 单产品活动 7 | /// 8 | public interface ISingleProductPromotion 9 | { 10 | PromotionContainsProduct GetPromotionContainsProduct(); 11 | 12 | bool IsExistedProduct(string productId); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/Promotion/Aggregate/MultiProductPromotionRule.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Collections.ObjectModel; 3 | using System.Linq; 4 | using Mall.Domain.SellingPrice.Promotion.ValueObject; 5 | 6 | namespace Mall.Domain.SellingPrice.Promotion.Aggregate 7 | { 8 | public abstract class MultiProductPromotionRule : PromotionRule, IMultiProductsPromotion 9 | { 10 | private readonly List _promotionContainsProducts = new List(); 11 | 12 | protected MultiProductPromotionRule(string promotionId, string title) 13 | : base(promotionId, title) 14 | { 15 | } 16 | 17 | public ReadOnlyCollection GetPromotionContainsProducts() 18 | { 19 | return this._promotionContainsProducts.AsReadOnly(); 20 | } 21 | 22 | public void JoinProduct(string productId, string productName) 23 | { 24 | if (this.IsExistedProduct(productId)) 25 | { 26 | return; 27 | } 28 | 29 | var promotionContainsProduct = new PromotionContainsProduct(productId, productName); 30 | this._promotionContainsProducts.Add(promotionContainsProduct); 31 | } 32 | 33 | public void RemoveProduct(string productId) 34 | { 35 | var promotionContainsProduct = this._promotionContainsProducts.SingleOrDefault(ent => ent.ProductId == productId); 36 | if (promotionContainsProduct == null) 37 | return; 38 | 39 | this._promotionContainsProducts.Remove(promotionContainsProduct); 40 | } 41 | 42 | public bool IsExistedProduct(string productId) 43 | { 44 | return this._promotionContainsProducts.Any(ent => ent.ProductId == productId); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/Promotion/Aggregate/PromotionRule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Mall.Domain.SellingPrice.Promotion.Aggregate 4 | { 5 | public abstract class PromotionRule : Infrastructure.DomainCore.AggregateRoot 6 | { 7 | public string Title { get; private set; } 8 | 9 | protected PromotionRule(string promotionId, string title) 10 | { 11 | if (string.IsNullOrWhiteSpace(promotionId)) 12 | throw new ArgumentNullException("promotionId"); 13 | 14 | if (string.IsNullOrWhiteSpace(title)) 15 | throw new ArgumentNullException("title"); 16 | 17 | this.ID = promotionId; 18 | this.Title = title; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/Promotion/Aggregate/PromotionRuleLimitTimeDiscount.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Mall.Domain.SellingPrice.Promotion.Aggregate 4 | { 5 | /// 6 | /// 限时折扣 7 | /// 8 | public class PromotionRuleLimitTimeDiscount : SingleProductPromotionRule 9 | { 10 | /// 11 | /// 限时折扣开始时间 12 | /// 13 | public DateTime StartTime { get; private set; } 14 | 15 | /// 16 | /// 限时折扣结束时间 17 | /// 18 | public DateTime EndTime { get; private set; } 19 | 20 | /// 21 | /// 限时售价 22 | /// 23 | public decimal LimitTimePrice { get; private set; } 24 | 25 | public PromotionRuleLimitTimeDiscount(string promotionId, string title, string containsProductId, string containsProductName, DateTime startTime, DateTime endTime, decimal limitTimePrice) 26 | : base(promotionId, title, containsProductId, containsProductName) 27 | { 28 | if (startTime == default(DateTime)) 29 | throw new ArgumentException("startTime不能为default(DateTime)", "startTime"); 30 | 31 | if (endTime == default(DateTime)) 32 | throw new ArgumentException("endTime不能为default(DateTime)", "endTime"); 33 | 34 | if (limitTimePrice < 0) 35 | throw new ArgumentException("price不能小于0", "limitTimePrice"); 36 | 37 | this.StartTime = startTime; 38 | this.EndTime = endTime; 39 | this.LimitTimePrice = limitTimePrice; 40 | } 41 | 42 | public decimal CalculateReducePrice(string productId, decimal unitPrice, DateTime dateTime) 43 | { 44 | if (!this.IsExistedProduct(productId)) 45 | return 0; 46 | 47 | var nowTime = dateTime; 48 | if (nowTime < this.StartTime || nowTime > this.EndTime) 49 | return 0; 50 | 51 | return unitPrice - this.LimitTimePrice; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/Promotion/Aggregate/PromotionRuleMeetReduction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Mall.Domain.SellingPrice.Promotion.ValueObject; 5 | 6 | namespace Mall.Domain.SellingPrice.Promotion.Aggregate 7 | { 8 | /// 9 | /// 满减 10 | /// 11 | public class PromotionRuleMeetReduction : MultiProductPromotionRule, IMultiProdcutsReducePricePromotion 12 | { 13 | /// 14 | /// 优惠金额 15 | /// 16 | public decimal ReducePrice { get; private set; } 17 | 18 | /// 19 | /// 满足金额 20 | /// 21 | public decimal MeetPrice { get; private set; } 22 | 23 | public PromotionRuleMeetReduction(string promotionId, string title, decimal meetPrice, decimal reducePrice) 24 | : base(promotionId, title) 25 | { 26 | if (reducePrice <= 0) 27 | throw new ArgumentException("reducePrice不能小于等于0", "reducePrice"); 28 | 29 | if (meetPrice < 0) 30 | throw new ArgumentException("fullPrice不能小于0", "meetPrice"); 31 | 32 | this.ReducePrice = reducePrice; 33 | this.MeetPrice = meetPrice; 34 | } 35 | 36 | /// 37 | /// 计算减免金额 38 | /// 39 | /// 购买的商品 40 | /// 41 | public decimal CalculateReducePrice(IEnumerable boughtProducts) 42 | { 43 | if (boughtProducts == null) 44 | return 0; 45 | 46 | var containsProducts = boughtProducts.Join(this.GetPromotionContainsProducts(), l => l.ProductId, r => r.ProductId, (l, r) => l).ToList(); 47 | if (containsProducts.Count == 0) 48 | return 0; 49 | 50 | var totalProductPrice = containsProducts.Sum(ent => ent.TotalDiscountedPrice); 51 | 52 | if (totalProductPrice < this.MeetPrice) 53 | return 0; 54 | 55 | return totalProductPrice <= this.ReducePrice ? totalProductPrice : this.ReducePrice; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/Promotion/Aggregate/SingleProductPromotionRule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mall.Domain.SellingPrice.Promotion.ValueObject; 3 | 4 | namespace Mall.Domain.SellingPrice.Promotion.Aggregate 5 | { 6 | public abstract class SingleProductPromotionRule : PromotionRule, ISingleProductPromotion 7 | { 8 | private readonly PromotionContainsProduct _promotionContainsProduct; 9 | 10 | protected SingleProductPromotionRule(string promotionId, string title, string containsProductId, string containsProductName) 11 | : base(promotionId, title) 12 | { 13 | if (string.IsNullOrWhiteSpace(containsProductId)) 14 | throw new ArgumentNullException("containsProductId"); 15 | 16 | if (string.IsNullOrWhiteSpace(containsProductName)) 17 | throw new ArgumentNullException("containsProductName"); 18 | 19 | this._promotionContainsProduct = new PromotionContainsProduct(containsProductId, containsProductName); 20 | } 21 | 22 | public PromotionContainsProduct GetPromotionContainsProduct() 23 | { 24 | return this._promotionContainsProduct; 25 | } 26 | 27 | public bool IsExistedProduct(string productId) 28 | { 29 | return this._promotionContainsProduct.ProductId == productId; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/Promotion/ValueObject/PromotionContainsProduct.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Mall.Domain.SellingPrice.Promotion.ValueObject 4 | { 5 | public class PromotionContainsProduct : Infrastructure.DomainCore.ValueObject 6 | { 7 | public string ProductId { get; private set; } 8 | 9 | public string ProductName { get; private set; } 10 | 11 | public PromotionContainsProduct(string productId, string productName) 12 | { 13 | if (string.IsNullOrWhiteSpace(productId)) 14 | throw new ArgumentNullException("productId"); 15 | 16 | if (string.IsNullOrWhiteSpace(productName)) 17 | throw new ArgumentNullException("productName"); 18 | 19 | this.ProductId = productId; 20 | this.ProductName = productName; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mall.Domain.SellingPrice")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Mall.Domain.SellingPrice")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("793ec3c3-7bde-4f2a-bf12-612ee62517f3")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.SellingPrice/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.SellingPrice/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.SellingPrice/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /Mall.Domain.SellingPrice/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain.SellingPrice/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /Mall.Domain/CartModule/Entity/CartItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Mall.Domain.CartModule.Entity 4 | { 5 | public class CartItem : Infrastructure.DomainCore.Entity 6 | { 7 | public int Quantity { get; private set; } 8 | 9 | public decimal UnitPrice { get; private set; } 10 | 11 | public string SelectedMultiProductsPromotionId { get; private set; } 12 | 13 | internal CartItem(string productId, int quantity, decimal unitPrice, string selectedMultiProductsPromotionId) 14 | { 15 | if (string.IsNullOrWhiteSpace(productId)) 16 | throw new ArgumentException("productId 不能为空", "productId"); 17 | 18 | if (quantity <= 0) 19 | throw new ArgumentException("quantity不能小于等于0", "quantity"); 20 | 21 | if (unitPrice < 0) 22 | throw new ArgumentException("unitPrice不能小于0", "unitPrice"); 23 | 24 | this.ID = productId; 25 | this.Quantity = quantity; 26 | this.UnitPrice = unitPrice; 27 | this.SelectedMultiProductsPromotionId = selectedMultiProductsPromotionId; 28 | } 29 | 30 | public void ModifyQuantity(int quantity) 31 | { 32 | if (quantity <= 0) 33 | throw new ArgumentException("quantity不能小于等于0", "quantity"); 34 | 35 | this.Quantity = quantity; 36 | } 37 | 38 | public void ModifyUnitPrice(decimal unitPrice) 39 | { 40 | if (unitPrice < 0) 41 | throw new ArgumentException("unitPrice不能小于0", "unitPrice"); 42 | 43 | this.UnitPrice = unitPrice; 44 | } 45 | 46 | public void ChangeMultiProductsPromotion(string selectedMultiProductsPromotionId) 47 | { 48 | this.SelectedMultiProductsPromotionId = selectedMultiProductsPromotionId; 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Mall.Domain/DeliveryModule/Aggregate/Express.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mall.Infrastructure.DomainCore; 3 | 4 | namespace Mall.Domain.DeliveryModule.Aggregate 5 | { 6 | public class Express : AggregateRoot 7 | { 8 | public string Name { get; private set; } 9 | 10 | public decimal Freight { get; private set; } 11 | 12 | public Express(string id, string name, decimal freight) 13 | { 14 | if (string.IsNullOrWhiteSpace(id)) 15 | throw new ArgumentNullException("id"); 16 | 17 | if (string.IsNullOrWhiteSpace(name)) 18 | throw new ArgumentNullException("name"); 19 | 20 | if (freight < 0) 21 | throw new ArgumentException("freight不能小于0"); 22 | 23 | this.ID = id; 24 | this.Name = name; 25 | this.Freight = freight; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Mall.Domain/FavoritesModule/Aggregate/Favorites.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Collections.ObjectModel; 4 | using System.Linq; 5 | using Mall.Domain.CartModule.Entity; 6 | using Mall.Domain.FavoritesModule.Entity; 7 | using Mall.Infrastructure.DomainCore; 8 | 9 | namespace Mall.Domain.FavoritesModule.Aggregate 10 | { 11 | public class Favorites : AggregateRoot 12 | { 13 | private readonly List _favoritesItems; 14 | 15 | public string UserId { get; private set; } 16 | 17 | public Favorites(string userId, IEnumerable favoritesItems) 18 | { 19 | if (string.IsNullOrWhiteSpace(userId)) 20 | throw new ArgumentNullException("userId"); 21 | 22 | this.UserId = userId; 23 | this._favoritesItems = new List(); 24 | 25 | if (favoritesItems != null && favoritesItems.Any()) 26 | { 27 | foreach (var favoritesItem in favoritesItems) 28 | { 29 | AddFavoritesItem(favoritesItem); 30 | } 31 | } 32 | } 33 | 34 | public ReadOnlyCollection GetFavoritesItems() 35 | { 36 | return this._favoritesItems.AsReadOnly(); 37 | } 38 | 39 | public void AddFavoritesItem(CartItem cartItem) 40 | { 41 | var favoritesItem = new FavoritesItem(cartItem.ID, DateTime.Now); 42 | AddFavoritesItem(favoritesItem); 43 | } 44 | 45 | public void RemoveFavoritesItem(string id) 46 | { 47 | var favoritesItem = this._favoritesItems.SingleOrDefault(ent => ent.ID == id); 48 | if (favoritesItem == null) 49 | return; 50 | 51 | this._favoritesItems.Remove(favoritesItem); 52 | } 53 | 54 | private void AddFavoritesItem(FavoritesItem favoritesItem) 55 | { 56 | if (this._favoritesItems.Any(ent => ent.ID == favoritesItem.ID)) 57 | return; 58 | this._favoritesItems.Add(favoritesItem); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Mall.Domain/FavoritesModule/Entity/FavoritesItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Mall.Domain.FavoritesModule.Entity 4 | { 5 | public class FavoritesItem 6 | { 7 | public string ID { get; private set; } 8 | 9 | public DateTime FavoriteTime { get; private set; } 10 | 11 | public FavoritesItem(string id, DateTime favoriteTime) 12 | { 13 | if (string.IsNullOrWhiteSpace(id)) 14 | throw new ArgumentNullException("id"); 15 | 16 | if (favoriteTime == default(DateTime)) 17 | throw new ArgumentException("favoriteTime"); 18 | 19 | this.ID = id; 20 | this.FavoriteTime = favoriteTime; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Mall.Domain/IRemoteServices/IOrderService.cs: -------------------------------------------------------------------------------- 1 | using Mall.Domain.ValueObject; 2 | using Mall.Infrastructure.Results; 3 | 4 | namespace Mall.Domain.IRemoteServices 5 | { 6 | public interface IOrderService 7 | { 8 | Result Create(WaitCreateOrder waitCreateOrder); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Mall.Domain/IRemoteServices/IPaymentService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Mall.Domain.ValueObject; 3 | 4 | namespace Mall.Domain.IRemoteServices 5 | { 6 | public interface IPaymentService 7 | { 8 | List GetAllPaymentMethods(); 9 | 10 | Wallet GetWalletByUserId(string userId); 11 | 12 | PaymentMethod GetPaymentMethod(string id); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Mall.Domain/IRemoteServices/IProductService.cs: -------------------------------------------------------------------------------- 1 | using Mall.Domain.ValueObject; 2 | 3 | namespace Mall.Domain.IRemoteServices 4 | { 5 | public interface IProductService 6 | { 7 | Product GetProduct(string productId); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Mall.Domain/IRemoteServices/ISellingPriceService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Security.Policy; 3 | using Mall.Domain.CartModule.Aggregate; 4 | using Mall.Domain.ValueObject; 5 | 6 | namespace Mall.Domain.IRemoteServices 7 | { 8 | public interface ISellingPriceService 9 | { 10 | SellingPriceCart Calculate(Cart cart); 11 | 12 | List CalculateAllCoupons(Cart cart); 13 | 14 | Coupon GetCoupon(string id); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Mall.Domain/IRemoteServices/IUserService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Mall.Domain.ValueObject; 4 | 5 | namespace Mall.Domain.IRemoteServices 6 | { 7 | public interface IUserService 8 | { 9 | User GetUser(string userId); 10 | 11 | List GetShippingAddressesByUserId(string userId); 12 | 13 | void AddNewShippingAddress(ShippingAddress newAddress); 14 | 15 | void EditShippingAddress(ShippingAddress editAddress); 16 | 17 | void DeleteShippingAddress(string id); 18 | 19 | ShippingAddress GetShippingAddress(string id); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Mall.Domain/IRepositories/ICartRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mall.Domain.CartModule.Aggregate; 3 | using Mall.Infrastructure.DomainCore; 4 | 5 | namespace Mall.Domain.IRepositories 6 | { 7 | public interface ICartRepository : IRepository 8 | { 9 | Cart GetByUserId(string userId); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Mall.Domain/IRepositories/IExpressRepository.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Mall.Domain.DeliveryModule.Aggregate; 3 | using Mall.Infrastructure.DomainCore; 4 | 5 | namespace Mall.Domain.IRepositories 6 | { 7 | public interface IExpressRepository : IRepository 8 | { 9 | List GetAll(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Mall.Domain/IRepositories/IFavoritesRepository.cs: -------------------------------------------------------------------------------- 1 | using Mall.Domain.FavoritesModule.Aggregate; 2 | using Mall.Infrastructure.DomainCore; 3 | 4 | namespace Mall.Domain.IRepositories 5 | { 6 | public interface IFavoritesRepository : IRepository 7 | { 8 | Favorites GetByUserId(string userId); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Mall.Domain/Mall.Domain.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ProjectFiles 5 | 6 | -------------------------------------------------------------------------------- /Mall.Domain/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mall.Domain")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Mall.Domain")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("ad804425-aae8-441b-a00f-0f2b538871ef")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Mall.Domain/ValueObject/Coupon.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Mall.Domain.ValueObject 4 | { 5 | public class Coupon : Infrastructure.DomainCore.ValueObject 6 | { 7 | public string ID { get; private set; } 8 | 9 | public string Name { get; private set; } 10 | 11 | public bool CanUse { get; private set; } 12 | 13 | public decimal Value { get; private set; } 14 | 15 | public DateTime ExpiryDate { get; private set; } 16 | 17 | public Coupon(string id, string name, bool canUse, decimal value, DateTime expiryDate) 18 | { 19 | if (string.IsNullOrWhiteSpace(id)) 20 | throw new ArgumentNullException("id"); 21 | 22 | if (string.IsNullOrWhiteSpace(name)) 23 | throw new ArgumentNullException("name"); 24 | 25 | this.ID = id; 26 | this.Name = name; 27 | this.CanUse = canUse; 28 | this.Value = value; 29 | this.ExpiryDate = expiryDate; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Mall.Domain/ValueObject/PaymentMethod.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Domain.ValueObject 2 | { 3 | public class PaymentMethod : Infrastructure.DomainCore.ValueObject 4 | { 5 | public string ID { get; private set; } 6 | 7 | public string Name { get; private set; } 8 | 9 | public PaymentMethod(string id, string name) 10 | { 11 | this.ID = id; 12 | this.Name = name; 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Mall.Domain/ValueObject/Product.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Mall.Domain.ValueObject 4 | { 5 | /// 6 | /// 商品 7 | /// 8 | public class Product : Infrastructure.DomainCore.ValueObject 9 | { 10 | /// 11 | /// 商品ID 12 | /// 13 | public string ProductId { get; private set; } 14 | 15 | /// 16 | /// 销售名称 17 | /// 18 | public string SaleName { get; private set; } 19 | 20 | /// 21 | /// 专柜价 22 | /// 23 | public decimal ShoppePrice { get; private set; } 24 | 25 | /// 26 | /// 销售价格 27 | /// 28 | public decimal SalePrice { get; private set; } 29 | 30 | /// 31 | /// 销售描述 32 | /// 33 | public string SaleDescription { get; private set; } 34 | 35 | /// 36 | /// 库存 37 | /// 38 | public int Stock { get; private set; } 39 | 40 | public Product(string productId, string saleName, decimal shoppePrice, decimal salePrice, string saleDescription, int stock) 41 | { 42 | if (string.IsNullOrWhiteSpace(productId)) 43 | throw new ArgumentException("productId 不能为空", "productId"); 44 | if (string.IsNullOrWhiteSpace(saleName)) 45 | throw new ArgumentNullException("saleName"); 46 | if (shoppePrice < 0) 47 | throw new ArgumentOutOfRangeException("shoppePrice", "参数不能小于0"); 48 | if (salePrice < 0) 49 | throw new ArgumentOutOfRangeException("salePrice", "参数不能小于0"); 50 | if (stock < 0) 51 | throw new ArgumentOutOfRangeException("stock", "参数不能小于0"); 52 | 53 | this.ProductId = productId; 54 | this.SaleName = saleName; 55 | this.ShoppePrice = shoppePrice; 56 | this.SalePrice = salePrice; 57 | this.SaleDescription = saleDescription; 58 | this.Stock = stock; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Mall.Domain/ValueObject/SellingPriceCart.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace Mall.Domain.ValueObject 6 | { 7 | public class SellingPriceCart 8 | { 9 | public string CartId { get; private set; } 10 | 11 | public SellingPriceFullGroup[] FullGroups { get; private set; } 12 | 13 | public SellingPriceCartItem[] CartItems { get; private set; } 14 | 15 | public SellingPriceCart(string cartId, IEnumerable sellingPriceFullGroups, IEnumerable cartItems) 16 | { 17 | if (string.IsNullOrWhiteSpace(cartId)) 18 | throw new ArgumentException("cartId不能为空", "cartId"); 19 | 20 | this.CartId = cartId; 21 | this.FullGroups = (sellingPriceFullGroups ?? new SellingPriceFullGroup[0]).ToArray(); 22 | this.CartItems = (cartItems ?? new SellingPriceCartItem[0]).ToArray(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Mall.Domain/ValueObject/SellingPriceCartItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Mall.Domain.ValueObject 4 | { 5 | public class SellingPriceCartItem 6 | { 7 | public string ProductId { get; private set; } 8 | 9 | public decimal ReducePrice { get; private set; } 10 | 11 | public SellingPriceCartItem(string productId, decimal reducePrice) 12 | { 13 | if (string.IsNullOrWhiteSpace(productId)) 14 | throw new ArgumentException("productIdB不能为空", "productId"); 15 | 16 | if (reducePrice < 0) 17 | throw new ArgumentException("reducePrice不能小于0", "reducePrice"); 18 | 19 | this.ProductId = productId; 20 | this.ReducePrice = reducePrice; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Mall.Domain/ValueObject/SellingPriceFullGroup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace Mall.Domain.ValueObject 6 | { 7 | public class SellingPriceFullGroup 8 | { 9 | public SellingPriceCartItem[] CartItems { get; private set; } 10 | 11 | public decimal ReducePrice { get; private set; } 12 | 13 | public string MultiProductsPromotionId { get; private set; } 14 | 15 | public SellingPriceFullGroup(IEnumerable cartItems, decimal reducePrice, string multiProductsPromotionId) 16 | { 17 | if (cartItems == null) 18 | throw new ArgumentNullException("cartItems"); 19 | 20 | if (!cartItems.Any()) 21 | throw new ArgumentException("cartItems不能为空"); 22 | 23 | if (reducePrice < 0) 24 | throw new ArgumentException("reducePrice不能小于0"); 25 | 26 | this.CartItems = cartItems.ToArray(); 27 | this.ReducePrice = reducePrice; 28 | this.MultiProductsPromotionId = multiProductsPromotionId; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Mall.Domain/ValueObject/User.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Mall.Domain.ValueObject 4 | { 5 | public class User : Infrastructure.DomainCore.ValueObject 6 | { 7 | /// 8 | /// 用户ID 9 | /// 10 | public string UserId { get; private set; } 11 | 12 | /// 13 | /// 用户名 14 | /// 15 | public string UserName { get; private set; } 16 | 17 | /// 18 | /// 可用余额 19 | /// 20 | public decimal AvailableBalance { get; private set; } 21 | 22 | public User(string userId, string userName, decimal availableBalance) 23 | { 24 | if (string.IsNullOrWhiteSpace(userId)) 25 | throw new ArgumentException("参数不能为空", "userId"); 26 | if (string.IsNullOrWhiteSpace(userName)) 27 | throw new ArgumentNullException("userName"); 28 | if (availableBalance < 0) 29 | throw new ArgumentOutOfRangeException("availableBalance", "参数不能小于0"); 30 | 31 | this.UserId = userId; 32 | this.UserName = userName; 33 | this.AvailableBalance = availableBalance; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Mall.Domain/ValueObject/WaitCreateOrderItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Mall.Domain.ValueObject 4 | { 5 | public class WaitCreateOrderItem 6 | { 7 | public string ProductId { get; private set; } 8 | 9 | public int Quantity { get; private set; } 10 | 11 | public decimal UnitPrice { get; private set; } 12 | 13 | public string JoinedMultiProductsPromotionId { get; private set; } 14 | 15 | public string ProductName { get; private set; } 16 | 17 | public WaitCreateOrderItem(string productId, int quantity, decimal unitPrice, string joinedMultiProductsPromotionId, string productName) 18 | { 19 | if (string.IsNullOrWhiteSpace(productId)) 20 | throw new ArgumentException("productId 不能为空", "productId"); 21 | 22 | if (quantity <= 0) 23 | throw new ArgumentException("quantity不能小于等于0", "quantity"); 24 | 25 | if (unitPrice < 0) 26 | throw new ArgumentException("unitPrice不能小于0", "unitPrice"); 27 | 28 | if (string.IsNullOrWhiteSpace(productName)) 29 | throw new ArgumentException("productName 不能为空", "productName"); 30 | 31 | this.ProductId = productId; 32 | this.Quantity = quantity; 33 | this.UnitPrice = unitPrice; 34 | this.JoinedMultiProductsPromotionId = joinedMultiProductsPromotionId; 35 | this.ProductName = productName; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Mall.Domain/ValueObject/Wallet.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Mall.Domain.ValueObject 4 | { 5 | public class Wallet : Infrastructure.DomainCore.ValueObject 6 | { 7 | public string ID { get; private set; } 8 | 9 | public string UserId { get; private set; } 10 | 11 | public decimal AvailableBalance { get; private set; } 12 | 13 | public int AvailableScore { get; private set; } 14 | 15 | public Wallet(string id, string userId, decimal availableBalance, int availableScore) 16 | { 17 | if (string.IsNullOrWhiteSpace(id)) 18 | throw new ArgumentNullException("id"); 19 | 20 | if (string.IsNullOrWhiteSpace(userId)) 21 | throw new ArgumentNullException("userId"); 22 | 23 | this.ID = id; 24 | this.UserId = userId; 25 | this.AvailableBalance = availableBalance; 26 | this.AvailableScore = availableScore; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Mall.Domain/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /Mall.Domain/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /Mall.Domain/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /Mall.Domain/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Domain/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /Mall.DomainService.Order/Class1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Mall.DomainService.Order 8 | { 9 | public class Class1 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Mall.DomainService.Order/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mall.DomainService.Order")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Mall.DomainService.Order")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("c455c2e3-f0be-484c-8c32-9c5018abf105")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Mall.DomainService.Order/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.DomainService.Order/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /Mall.DomainService.Order/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.DomainService.Order/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /Mall.DomainService.Order/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.DomainService.Order/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /Mall.DomainService.Order/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.DomainService.Order/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /Mall.DomainService.SellingPrice/Mall.DomainService.SellingPrice.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ShowAllFiles 5 | 6 | -------------------------------------------------------------------------------- /Mall.DomainService.SellingPrice/MergeSingleProductPromotionForOneProductDomainService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Mall.Domain.SellingPrice.Promotion.Aggregate; 4 | 5 | namespace Mall.DomainService.SellingPrice 6 | { 7 | /// 8 | /// 合并单个购买商品所参与的单品促销优惠数据。 9 | /// 10 | public class MergeSingleProductPromotionForOneProductDomainService 11 | { 12 | /// 13 | /// 合并,目前仅存在一种情况即限制折扣。 14 | /// 15 | /// 16 | /// 17 | /// 18 | /// 19 | public decimal Merge(string productId, decimal unitPrice, IEnumerable singleProductPromotionRules) 20 | { 21 | decimal reducePrice = 0; 22 | 23 | foreach (var promotionRule in singleProductPromotionRules) 24 | { 25 | var tempReducePrice = ((PromotionRuleLimitTimeDiscount)promotionRule).CalculateReducePrice(productId, unitPrice, DateTime.Now); //在创建的时候约束促销的重复性。此处逻辑上允许重复 26 | if (unitPrice - reducePrice <= tempReducePrice) 27 | { 28 | reducePrice = unitPrice; 29 | } 30 | else 31 | { 32 | reducePrice += tempReducePrice; 33 | } 34 | } 35 | 36 | return reducePrice; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Mall.DomainService.SellingPrice/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mall.DomainService.SellingPrice")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Mall.DomainService.SellingPrice")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("ff0ad576-8a69-4800-8eab-c4a286640555")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Mall.DomainService.SellingPrice/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.DomainService.SellingPrice/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /Mall.DomainService.SellingPrice/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.DomainService.SellingPrice/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /Mall.DomainService.SellingPrice/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.DomainService.SellingPrice/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /Mall.DomainService.SellingPrice/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.DomainService.SellingPrice/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /Mall.DomainService/ConfirmUserCartExistedDomainService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mall.Domain; 3 | using Mall.Domain.CartModule.Aggregate; 4 | 5 | namespace Mall.DomainService 6 | { 7 | public class ConfirmUserCartExistedDomainService 8 | { 9 | public Cart GetUserCart(string userId) 10 | { 11 | var cart = DomainRegistry.CartRepository().GetByUserId(userId); 12 | if (cart == null) 13 | { 14 | cart = new Cart(DomainRegistry.CartRepository().NextIdentity(), userId, DateTime.Now); 15 | DomainRegistry.CartRepository().Save(cart); 16 | } 17 | 18 | return cart; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Mall.DomainService/Mall.DomainService.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ProjectFiles 5 | 6 | -------------------------------------------------------------------------------- /Mall.DomainService/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mall.DomainService")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Mall.DomainService")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("783dbf22-f056-4c89-ae08-3ff022ac8836")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Mall.DomainService/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.DomainService/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /Mall.DomainService/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.DomainService/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /Mall.DomainService/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.DomainService/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /Mall.DomainService/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.DomainService/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /Mall.Infrastructure.Order.Translators/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mall.Infrastructure.Order.Translators")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Mall.Infrastructure.Order.Translators")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("21251fbd-8ec2-4689-ba69-bff03ba25291")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Order.Translators/SellingPrice/SellingPriceAdapter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mall.Application.SellingPrice; 3 | using Mall.Infrastructure.Results; 4 | 5 | namespace Mall.Infrastructure.Order.Translators.SellingPrice 6 | { 7 | public class SellingPriceAdapter 8 | { 9 | private static readonly SellingPriceTranslator _sellingPriceTranslator = new SellingPriceTranslator(); 10 | private static readonly ICouponService _couponService = new CouponService(); 11 | 12 | public Result IsCouponCanUse(string couponId, DateTime orderTime) 13 | { 14 | return _couponService.IsCouponCanUse(couponId, orderTime); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Order.Translators/SellingPrice/SellingPriceService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mall.Domain.Order.IRemoteServices; 3 | using Mall.Infrastructure.Results; 4 | 5 | namespace Mall.Infrastructure.Order.Translators.SellingPrice 6 | { 7 | public class SellingPriceService : ISellingPriceService 8 | { 9 | private static readonly SellingPriceAdapter _sellingPriceAdapter = new SellingPriceAdapter(); 10 | public Result IsCouponCanUse(string id, DateTime orderTime) 11 | { 12 | return _sellingPriceAdapter.IsCouponCanUse(id, orderTime); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Order.Translators/SellingPrice/SellingPriceTranslator.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Infrastructure.Order.Translators.SellingPrice 2 | { 3 | public class SellingPriceTranslator 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Order.Translators/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Infrastructure.Order.Translators/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /Mall.Infrastructure.Order.Translators/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Infrastructure.Order.Translators/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /Mall.Infrastructure.Order.Translators/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Infrastructure.Order.Translators/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /Mall.Infrastructure.Order.Translators/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Infrastructure.Order.Translators/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /Mall.Infrastructure.Repositories/CartSqlServerRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mall.Domain.CartModule.Aggregate; 3 | using Mall.Domain.IRepositories; 4 | 5 | namespace Mall.Infrastructure.Repositories 6 | { 7 | public class CartSqlServerRepository : ICartRepository 8 | { 9 | public string NextIdentity() 10 | { 11 | throw new NotImplementedException(); 12 | } 13 | 14 | public void Save(Cart cart) 15 | { 16 | throw new NotImplementedException(); 17 | } 18 | 19 | public void Remove(string identity) 20 | { 21 | throw new NotImplementedException(); 22 | } 23 | 24 | public Cart GetByIdentity(string identity) 25 | { 26 | throw new NotImplementedException(); 27 | } 28 | 29 | public Cart GetByUserId(string userId) 30 | { 31 | throw new NotImplementedException(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Repositories/CouponNoRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Mall.Domain.SellingPrice.Coupon.Aggregate; 4 | using Mall.Domain.SellingPrice.IRepositories; 5 | 6 | namespace Mall.Infrastructure.Repositories 7 | { 8 | public class CouponNoRepository : ICouponNoRepository 9 | { 10 | public string NextIdentity() 11 | { 12 | throw new NotImplementedException(); 13 | } 14 | 15 | public void Save(CouponNo aggregate) 16 | { 17 | throw new NotImplementedException(); 18 | } 19 | 20 | public CouponNo GetByIdentity(string identity) 21 | { 22 | throw new NotImplementedException(); 23 | } 24 | 25 | public List GetNotUsedByUserId(string userId) 26 | { 27 | throw new NotImplementedException(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Repositories/CouponRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mall.Domain.SellingPrice.Coupon.Aggregate; 3 | using Mall.Domain.SellingPrice.IRepositories; 4 | 5 | namespace Mall.Infrastructure.Repositories 6 | { 7 | public class CouponRepository : ICouponRepository 8 | { 9 | public string NextIdentity() 10 | { 11 | throw new NotImplementedException(); 12 | } 13 | 14 | public void Save(Coupon aggregate) 15 | { 16 | throw new NotImplementedException(); 17 | } 18 | 19 | public Coupon GetByIdentity(string identity) 20 | { 21 | throw new NotImplementedException(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Repositories/ExpressSqlServerRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Mall.Domain.DeliveryModule.Aggregate; 4 | using Mall.Domain.IRepositories; 5 | 6 | namespace Mall.Infrastructure.Repositories 7 | { 8 | public class ExpressSqlServerRepository : IExpressRepository 9 | { 10 | public string NextIdentity() 11 | { 12 | throw new NotImplementedException(); 13 | } 14 | 15 | public void Save(Express aggregate) 16 | { 17 | throw new NotImplementedException(); 18 | } 19 | 20 | public Express GetByIdentity(string identity) 21 | { 22 | throw new NotImplementedException(); 23 | } 24 | 25 | public List GetAll() 26 | { 27 | throw new NotImplementedException(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Repositories/FavoritesSqlServerRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mall.Domain.FavoritesModule.Aggregate; 3 | using Mall.Domain.IRepositories; 4 | 5 | namespace Mall.Infrastructure.Repositories 6 | { 7 | public class FavoritesSqlServerRepository : IFavoritesRepository 8 | { 9 | public string NextIdentity() 10 | { 11 | throw new NotImplementedException(); 12 | } 13 | 14 | public void Save(Favorites aggregate) 15 | { 16 | throw new NotImplementedException(); 17 | } 18 | 19 | public Favorites GetByIdentity(string identity) 20 | { 21 | throw new NotImplementedException(); 22 | } 23 | 24 | public Favorites GetByUserId(string userId) 25 | { 26 | throw new NotImplementedException(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Repositories/OrderSqlServerRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mall.Domain.Order.Aggregate; 3 | using Mall.Domain.Order.IRepositories; 4 | 5 | namespace Mall.Infrastructure.Repositories 6 | { 7 | public class OrderSqlServerRepository : IOrderRepository 8 | { 9 | public string NextIdentity() 10 | { 11 | throw new NotImplementedException(); 12 | } 13 | 14 | public void Save(Order aggregate) 15 | { 16 | throw new NotImplementedException(); 17 | } 18 | 19 | public Order GetByIdentity(string identity) 20 | { 21 | throw new NotImplementedException(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Repositories/PromotionSqlServerRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Mall.Domain.SellingPrice.IRepositories; 4 | using Mall.Domain.SellingPrice.Promotion.Aggregate; 5 | 6 | namespace Mall.Infrastructure.Repositories 7 | { 8 | public class PromotionSqlServerRepository : IPromotionRepository 9 | { 10 | public string NextIdentity() 11 | { 12 | throw new NotImplementedException(); 13 | } 14 | 15 | public void Save(PromotionRule aggregate) 16 | { 17 | throw new NotImplementedException(); 18 | } 19 | 20 | public void Remove(string identity) 21 | { 22 | throw new NotImplementedException(); 23 | } 24 | 25 | public PromotionRule GetByIdentity(string identity) 26 | { 27 | throw new NotImplementedException(); 28 | } 29 | 30 | public IList GetListByContainsProductId(string productId) 31 | { 32 | throw new NotImplementedException(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Repositories/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mall.Infrastructure.Repositories")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Mall.Infrastructure.Repositories")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("7665fb8e-7b4d-4253-980c-814f057000be")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Repositories/RoleDiscountRelationRepository.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mall.Domain.SellingPrice.IRepositories; 3 | using Mall.Domain.SellingPrice.MemberPrice.ValueObject; 4 | 5 | namespace Mall.Infrastructure.Repositories 6 | { 7 | public class RoleDiscountRelationRepository : IRoleDiscountRelationRepository 8 | { 9 | public string NextIdentity() 10 | { 11 | throw new NotImplementedException(); 12 | } 13 | 14 | public void Save(RoleDiscountRelation aggregate) 15 | { 16 | throw new NotImplementedException(); 17 | } 18 | 19 | public RoleDiscountRelation GetByIdentity(string identity) 20 | { 21 | throw new NotImplementedException(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Repositories/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Infrastructure.Repositories/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /Mall.Infrastructure.Repositories/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Infrastructure.Repositories/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /Mall.Infrastructure.Repositories/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Infrastructure.Repositories/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /Mall.Infrastructure.Repositories/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Infrastructure.Repositories/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /Mall.Infrastructure.SellingPrice.Translators/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mall.Infrastructure.SellingPrice.Translators")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Mall.Infrastructure.SellingPrice.Translators")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("28a4e898-be2d-450f-a24f-ad9d5557ead5")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Mall.Infrastructure.SellingPrice.Translators/User/UserAdapter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Net; 4 | using System.Text; 5 | using Mall.Domain.SellingPrice.MemberPrice.ValueObject; 6 | 7 | namespace Mall.Infrastructure.SellingPrice.Translators.User 8 | { 9 | public class UserAdapter 10 | { 11 | private static readonly UserTranslator _userTranslator = new UserTranslator(); 12 | 13 | public UserRoleRelation GetUserRoleRelation(string userId) 14 | { 15 | var url = string.Format("http://www.test.com/userrolerelation/{0}", userId.ToString()); 16 | HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(url); 17 | using (HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse()) 18 | { 19 | if (httpWebResponse.StatusCode == HttpStatusCode.OK) 20 | { 21 | using (var stream = httpWebResponse.GetResponseStream()) 22 | { 23 | var strReturn = new StreamReader(stream, Encoding.UTF8).ReadToEnd(); 24 | return _userTranslator.ToUserRoleRelation(strReturn); 25 | } 26 | } 27 | 28 | throw new ApplicationException("获取用户信息请求失败,状态码:" + httpWebResponse.StatusCode.ToString()); 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Mall.Infrastructure.SellingPrice.Translators/User/UserService.cs: -------------------------------------------------------------------------------- 1 | using Mall.Domain.SellingPrice.IRemoteServices; 2 | using Mall.Domain.SellingPrice.MemberPrice.ValueObject; 3 | 4 | namespace Mall.Infrastructure.SellingPrice.Translators.User 5 | { 6 | public class UserService : IUserService 7 | { 8 | private static readonly UserAdapter _userAdapter = new UserAdapter(); 9 | 10 | public UserRoleRelation GetUserRoleRelation(string userId) 11 | { 12 | return _userAdapter.GetUserRoleRelation(userId); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Mall.Infrastructure.SellingPrice.Translators/User/UserTranslator.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | using Mall.Domain.SellingPrice.MemberPrice.ValueObject; 3 | using Mall.Infrastructure.ResponseHandle; 4 | 5 | namespace Mall.Infrastructure.SellingPrice.Translators.User 6 | { 7 | public class UserTranslator 8 | { 9 | public UserRoleRelation ToUserRoleRelation(string jsonData) 10 | { 11 | JsonResponseReader reader = new JsonResponseReader(jsonData); 12 | string userId = reader.GetString("userId"); 13 | string roleId = reader.GetString("roleId"); 14 | 15 | if (userId == null) 16 | throw new NoNullAllowedException("未能正常解析用户ID"); 17 | 18 | if (roleId == null) 19 | throw new NoNullAllowedException("未能正常解析等级ID"); 20 | 21 | var user = new UserRoleRelation(userId, roleId); 22 | return user; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Mall.Infrastructure.SellingPrice.Translators/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Infrastructure.SellingPrice.Translators/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /Mall.Infrastructure.SellingPrice.Translators/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Infrastructure.SellingPrice.Translators/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /Mall.Infrastructure.SellingPrice.Translators/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Infrastructure.SellingPrice.Translators/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /Mall.Infrastructure.SellingPrice.Translators/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Infrastructure.SellingPrice.Translators/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /Mall.Infrastructure.Translators/Order/OrderService.cs: -------------------------------------------------------------------------------- 1 | using Mall.Domain.IRemoteServices; 2 | using Mall.Domain.ValueObject; 3 | using Mall.Infrastructure.Results; 4 | 5 | namespace Mall.Infrastructure.Translators.Order 6 | { 7 | public class OrderService : IOrderService 8 | { 9 | private static readonly OrderAdapter _orderAdapter = new OrderAdapter(); 10 | public Result Create(WaitCreateOrder waitCreateOrder) 11 | { 12 | return _orderAdapter.Create(waitCreateOrder); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Translators/Order/OrderTranslator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Mall.Infrastructure.Translators.Order 8 | { 9 | class OrderTranslator 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Translators/Payment/PaymentService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using Mall.Domain.IRemoteServices; 4 | using Mall.Domain.ValueObject; 5 | 6 | namespace Mall.Infrastructure.Translators.Payment 7 | { 8 | public class PaymentService : IPaymentService 9 | { 10 | private static readonly PaymentAdapter _paymentAdapter = new PaymentAdapter(); 11 | 12 | public List GetAllPaymentMethods() 13 | { 14 | return _paymentAdapter.GetAllPaymentMethods().ToList(); 15 | } 16 | 17 | public Wallet GetWalletByUserId(string userId) 18 | { 19 | return _paymentAdapter.GetWalletByUserId(userId); 20 | } 21 | 22 | public PaymentMethod GetPaymentMethod(string id) 23 | { 24 | return _paymentAdapter.GetPaymentMethod(id); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Translators/Payment/PaymentTranslator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Data; 3 | using Mall.Domain.ValueObject; 4 | using Mall.Infrastructure.ResponseHandle; 5 | 6 | namespace Mall.Infrastructure.Translators.Payment 7 | { 8 | public class PaymentTranslator 9 | { 10 | public PaymentMethod[] ToPaymentMethods(string jsonData) 11 | { 12 | throw new NotImplementedException(); 13 | } 14 | 15 | public PaymentMethod ToPaymentMethod(string jsonData) 16 | { 17 | throw new NotImplementedException(); 18 | } 19 | 20 | public Wallet ToWallet(string jsonData) 21 | { 22 | JsonResponseReader reader = new JsonResponseReader(jsonData); 23 | string idstr = reader.GetString("id"); 24 | string userId = reader.GetString("userId"); 25 | string availableBalanceStr = reader.GetString("availableBalance"); 26 | string availableScoreStr = reader.GetString("availableScore"); 27 | 28 | if (idstr == null) 29 | throw new NoNullAllowedException("未能正常解析钱包ID"); 30 | 31 | if (userId == null) 32 | throw new NoNullAllowedException("未能正常解析用户ID"); 33 | 34 | decimal availableBalance; 35 | if (availableBalanceStr == null || !decimal.TryParse(availableBalanceStr, out availableBalance)) 36 | throw new NoNullAllowedException("未能正常解析可用余额"); 37 | 38 | int availableScore; 39 | if (availableScoreStr == null || !int.TryParse(availableScoreStr, out availableScore)) 40 | throw new NoNullAllowedException("未能正常解析可用积分"); 41 | 42 | var wallet = new Wallet(idstr, userId, availableBalance, availableScore); 43 | return wallet; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Translators/Product/ProductAdapter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Net; 4 | using System.Text; 5 | 6 | namespace Mall.Infrastructure.Translators.Product 7 | { 8 | public class ProductAdapter 9 | { 10 | private static readonly ProductTranslator _productTranslator = new ProductTranslator(); 11 | 12 | public Domain.ValueObject.Product GetProduct(string productId) 13 | { 14 | var url = string.Format("http://www.test.com/product/{0}", productId.ToString()); 15 | HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(url); 16 | using (HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse()) 17 | { 18 | if (httpWebResponse.StatusCode == HttpStatusCode.OK) 19 | { 20 | using (var stream = httpWebResponse.GetResponseStream()) 21 | { 22 | var strReturn = new StreamReader(stream, Encoding.UTF8).ReadToEnd(); 23 | return _productTranslator.ToProduct(strReturn); 24 | } 25 | } 26 | 27 | throw new ApplicationException("获取商品信息请求失败,状态码:" + httpWebResponse.StatusCode.ToString()); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Translators/Product/ProductService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mall.Domain.IRemoteServices; 3 | 4 | namespace Mall.Infrastructure.Translators.Product 5 | { 6 | public class ProductService : IProductService 7 | { 8 | private static readonly ProductAdapter _productAdapter = new ProductAdapter(); 9 | public Domain.ValueObject.Product GetProduct(string productId) 10 | { 11 | return _productAdapter.GetProduct(productId); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Translators/Product/ProductTranslator.cs: -------------------------------------------------------------------------------- 1 | using System.Data; 2 | using Mall.Infrastructure.ResponseHandle; 3 | 4 | namespace Mall.Infrastructure.Translators.Product 5 | { 6 | public class ProductTranslator 7 | { 8 | public Domain.ValueObject.Product ToProduct(string jsonData) 9 | { 10 | JsonResponseReader reader = new JsonResponseReader(jsonData); 11 | string productIdstr = reader.GetString("productId"); 12 | string saleName = reader.GetString("saleName"); 13 | string shoppePriceStr = reader.GetString("shoppePrice"); 14 | string salePriceStr = reader.GetString("salePrice"); 15 | string saleDescription = reader.GetString("saleDescription"); 16 | string stockStr = reader.GetString("stock"); 17 | 18 | if (productIdstr == null) 19 | throw new NoNullAllowedException("未能正常解析商品ID"); 20 | 21 | if (saleName == null) 22 | throw new NoNullAllowedException("未能正常解析销售名称"); 23 | 24 | decimal shoppePrice; 25 | if (shoppePriceStr == null || !decimal.TryParse(shoppePriceStr, out shoppePrice)) 26 | throw new NoNullAllowedException("未能正常解析专柜价"); 27 | 28 | decimal salePrice; 29 | if (salePriceStr == null || !decimal.TryParse(salePriceStr, out salePrice)) 30 | throw new NoNullAllowedException("未能正常解析销售价"); 31 | 32 | if (saleDescription == null) 33 | throw new NoNullAllowedException("未能正常解析销售描述"); 34 | 35 | int stock; 36 | if (stockStr == null || !int.TryParse(stockStr, out stock)) 37 | throw new NoNullAllowedException("未能正常解析库存"); 38 | 39 | var product = new Domain.ValueObject.Product(productIdstr, saleName, shoppePrice, salePrice, saleDescription, stock); 40 | return product; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Translators/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mall.Infrastructure.Translators")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Mall.Infrastructure.Translators")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("88c098ac-7c2c-4806-bc72-cc59d25f016a")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Translators/SellingPrice/SellingPriceAdapter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using Mall.Application.SellingPrice; 4 | using Mall.Application.SellingPrice.DTO; 5 | using Mall.Domain.CartModule.Aggregate; 6 | using Mall.Domain.ValueObject; 7 | 8 | namespace Mall.Infrastructure.Translators.SellingPrice 9 | { 10 | public class SellingPriceAdapter 11 | { 12 | private static readonly SellingPriceTranslator _sellingPriceTranslator = new SellingPriceTranslator(); 13 | private static readonly ICalculateSalePriceService _calculateSalePriceService = new CalculateSalePriceService(); 14 | private static readonly ICouponService _couponService = new CouponService(); 15 | 16 | public SellingPriceCart Calculate(Cart cart) 17 | { 18 | var dto = _calculateSalePriceService.Calculate(ToRequest(cart)); 19 | return _sellingPriceTranslator.ToSellingPriceCart(dto); 20 | } 21 | 22 | public List CalculateAllCoupons(Cart cart) 23 | { 24 | var couponDtos = _couponService.Calculate(ToRequest(cart)); 25 | return _sellingPriceTranslator.ToCoupons(couponDtos); 26 | } 27 | 28 | public Coupon GetCoupon(string id) 29 | { 30 | var couponDto = _couponService.GetCoupon(id); 31 | return _sellingPriceTranslator.ToCoupon(couponDto); 32 | } 33 | 34 | private CartRequest ToRequest(Cart cart) 35 | { 36 | return new CartRequest 37 | { 38 | CartItems = cart.GetCartItems().Select(ent => new CartItemRequest 39 | { 40 | ProductId = ent.ID, 41 | Quantity = ent.Quantity, 42 | UnitPrice = ent.UnitPrice, 43 | SelectedMultiProductsPromotionId = ent.SelectedMultiProductsPromotionId 44 | }).ToArray(), 45 | CartId = cart.ID, 46 | UserId = cart.UserId 47 | }; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Translators/SellingPrice/SellingPriceService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Mall.Domain.CartModule.Aggregate; 3 | using Mall.Domain.IRemoteServices; 4 | using Mall.Domain.ValueObject; 5 | 6 | namespace Mall.Infrastructure.Translators.SellingPrice 7 | { 8 | public class SellingPriceService : ISellingPriceService 9 | { 10 | private static readonly SellingPriceAdapter _sellingPriceAdapter = new SellingPriceAdapter(); 11 | 12 | public SellingPriceCart Calculate(Cart cart) 13 | { 14 | return _sellingPriceAdapter.Calculate(cart); 15 | } 16 | 17 | public List CalculateAllCoupons(Cart cart) 18 | { 19 | return _sellingPriceAdapter.CalculateAllCoupons(cart); 20 | } 21 | 22 | public Coupon GetCoupon(string id) 23 | { 24 | return _sellingPriceAdapter.GetCoupon(id); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Translators/SellingPrice/SellingPriceTranslator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Mall.Application.SellingPrice.DTO; 5 | using Mall.Domain.ValueObject; 6 | 7 | namespace Mall.Infrastructure.Translators.SellingPrice 8 | { 9 | public class SellingPriceTranslator 10 | { 11 | public SellingPriceCart ToSellingPriceCart(CalculatedCartDTO cartDTO) 12 | { 13 | var fullGroups = cartDTO.CalculatedFullGroups.Select(ToSellingPriceFullGroup); 14 | var cartItems = cartDTO.CalculatedCartItems.Select(ToSellingPriceCartItem); 15 | return new SellingPriceCart(cartDTO.CartId, fullGroups, cartItems); 16 | } 17 | 18 | private SellingPriceFullGroup ToSellingPriceFullGroup(CalculatedFullGroupDTO dto) 19 | { 20 | return new SellingPriceFullGroup(dto.CalculatedCartItems.Select(ToSellingPriceCartItem), dto.ReducePrice, dto.MultiProductsPromotionId); 21 | } 22 | 23 | private SellingPriceCartItem ToSellingPriceCartItem(CalculatedCartItemDTO dto) 24 | { 25 | return new SellingPriceCartItem(dto.ProductId, dto.ReducePrice); 26 | } 27 | 28 | public List ToCoupons(IEnumerable coupons) 29 | { 30 | if (coupons == null) 31 | return null; 32 | return coupons.Select(ent => new Coupon(ent.ID, ent.Name, ent.CanUse, ent.Value, ent.ExpiryDate)).ToList(); 33 | } 34 | 35 | public Coupon ToCoupon(CouponDTO coupon) 36 | { 37 | if (coupon == null) 38 | throw new ArgumentNullException("coupon"); 39 | return new Coupon(coupon.ID, coupon.Name, coupon.CanUse, coupon.Value, coupon.ExpiryDate); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Translators/User/UserService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Mall.Domain.IRemoteServices; 3 | using Mall.Domain.ValueObject; 4 | 5 | namespace Mall.Infrastructure.Translators.User 6 | { 7 | public class UserService : IUserService 8 | { 9 | private static readonly UserAdapter _userAdapter = new UserAdapter(); 10 | 11 | public Domain.ValueObject.User GetUser(string userId) 12 | { 13 | return _userAdapter.GetUser(userId); 14 | } 15 | 16 | public List GetShippingAddressesByUserId(string userId) 17 | { 18 | return _userAdapter.GetShippingAddressesByUserId(userId); 19 | } 20 | 21 | public void AddNewShippingAddress(ShippingAddress newAddress) 22 | { 23 | _userAdapter.AddNewShippingAddress(newAddress); 24 | } 25 | 26 | public void EditShippingAddress(ShippingAddress editAddress) 27 | { 28 | _userAdapter.EditShippingAddress(editAddress); 29 | } 30 | 31 | public void DeleteShippingAddress(string id) 32 | { 33 | _userAdapter.DeleteShippingAddress(id); 34 | } 35 | 36 | public ShippingAddress GetShippingAddress(string id) 37 | { 38 | return _userAdapter.GetShippingAddress(id); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Translators/User/UserTranslator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data; 4 | using Mall.Domain.ValueObject; 5 | using Mall.Infrastructure.ResponseHandle; 6 | 7 | namespace Mall.Infrastructure.Translators.User 8 | { 9 | public class UserTranslator 10 | { 11 | public Domain.ValueObject.User ToUser(string jsonData) 12 | { 13 | JsonResponseReader reader = new JsonResponseReader(jsonData); 14 | string userIdstr = reader.GetString("userId"); 15 | string userName = reader.GetString("userName"); 16 | string availableBalanceStr = reader.GetString("availableBalance"); 17 | 18 | if (userIdstr == null) 19 | throw new NoNullAllowedException("未能正常解析用户ID"); 20 | 21 | if (userName == null) 22 | throw new NoNullAllowedException("未能正常解析用户名"); 23 | 24 | decimal availableBalance; 25 | if (availableBalanceStr == null || !decimal.TryParse(availableBalanceStr, out availableBalance)) 26 | throw new NoNullAllowedException("未能正常解析可用余额"); 27 | 28 | var user = new Domain.ValueObject.User(userIdstr, userName, availableBalance); 29 | return user; 30 | } 31 | 32 | public List ToShippingAddresses(string jsonData) 33 | { 34 | throw new NotImplementedException(); 35 | } 36 | 37 | public ShippingAddress ToShippingAddress(string jsonData) 38 | { 39 | throw new NotImplementedException(); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Mall.Infrastructure.Translators/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Infrastructure.Translators/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /Mall.Infrastructure.Translators/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Infrastructure.Translators/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /Mall.Infrastructure.Translators/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Infrastructure.Translators/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /Mall.Infrastructure.Translators/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Infrastructure.Translators/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /Mall.Infrastructure/DomainCore/AggregateRoot.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Infrastructure.DomainCore 2 | { 3 | /// 4 | /// 表示继承该类的是一个聚合根 5 | /// 6 | public abstract class AggregateRoot : Entity, IAloneStorable 7 | { 8 | 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Mall.Infrastructure/DomainCore/AloneStorableValueObject.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Infrastructure.DomainCore 2 | { 3 | /// 4 | /// 表示一个可独立持久化的值对象 5 | /// 6 | public abstract class AloneStorableValueObject : DelegateIdentifier, IAloneStorable 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Mall.Infrastructure/DomainCore/ConcurrencySafeAggregate.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Infrastructure.DomainCore 2 | { 3 | /// 4 | /// 标识继承该类的是一个需要保证线程安全的聚合 5 | /// 6 | public class ConcurrencySafeAggregate : ConcurrencySafeEntity 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Mall.Infrastructure/DomainCore/ConcurrencySafeEntity.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Infrastructure.DomainCore 2 | { 3 | /// 4 | /// 标识继承该类的是一个需要保证线程安全的实体 5 | /// 6 | public class ConcurrencySafeEntity : Entity 7 | { 8 | /// 9 | /// 乐观并发的版本号 10 | /// 11 | protected int VersionNo { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Mall.Infrastructure/DomainCore/DelegateIdentifier.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Infrastructure.DomainCore 2 | { 3 | /// 4 | /// 表示继承该类的是拥有一个唯一标识的对象 5 | /// 6 | public abstract class DelegateIdentifier 7 | { 8 | /// 9 | /// 委派标识 10 | /// 11 | protected string Identity { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Mall.Infrastructure/DomainCore/Entity.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Infrastructure.DomainCore 2 | { 3 | /// 4 | /// 表示继承该类的是一个实体 5 | /// 6 | public abstract class Entity : DelegateIdentifier 7 | { 8 | public string ID 9 | { 10 | get { return this.Identity; } 11 | protected set { this.Identity = value; } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Mall.Infrastructure/DomainCore/IAloneStorable.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Infrastructure.DomainCore 2 | { 3 | /// 4 | /// 表示可独立存储的对象 5 | /// 6 | public interface IAloneStorable 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Mall.Infrastructure/DomainCore/IRepository.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Infrastructure.DomainCore 2 | { 3 | public interface IRepository where T : DelegateIdentifier, IAloneStorable 4 | { 5 | string NextIdentity(); 6 | 7 | void Save(T aggregate); 8 | 9 | T GetByIdentity(string identity); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Mall.Infrastructure/DomainCore/IUnitOfWork.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Infrastructure.DomainCore 2 | { 3 | /// 4 | /// 表示所有集成于该接口的类型都是Unit Of Work的一种实现。 5 | /// 6 | public interface IUnitOfWork 7 | { 8 | /// 9 | /// 获得一个值,该值表述了当前的Unit Of Work事务是否已被提交。 10 | /// 11 | bool Committed { get; } 12 | 13 | /// 14 | /// 提交当前的Unit Of Work事务。 15 | /// 16 | bool Commit(); 17 | 18 | /// 19 | /// 回滚当前的Unit Of Work事务。 20 | /// 21 | void Rollback(); 22 | 23 | TRepositoryItem LockObject(TRepositoryItem obj) 24 | where TRepositoryItem : AggregateRoot; 25 | 26 | void RegisterSaved(TRepositoryItem obj) 27 | where TRepositoryItem : AggregateRoot; 28 | 29 | void RegisterRemoved(TRepositoryItem obj) 30 | where TRepositoryItem : AggregateRoot; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Mall.Infrastructure/DomainCore/SqlServerUnitOfWork.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Mall.Infrastructure.DomainCore 4 | { 5 | public class SqlServerUnitOfWork : UnitOfWork 6 | { 7 | public override bool Commit() 8 | { 9 | throw new NotImplementedException(); 10 | } 11 | 12 | public override void Rollback() 13 | { 14 | throw new NotImplementedException(); 15 | } 16 | 17 | public override TRepositoryItem LockObject(TRepositoryItem obj) 18 | { 19 | throw new NotImplementedException(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Mall.Infrastructure/DomainCore/ValueObject.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Infrastructure.DomainCore 2 | { 3 | /// 4 | /// 表示继承该类的是值对象 5 | /// 6 | public abstract class ValueObject 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Mall.Infrastructure/DomainEventCore/DomainEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Mall.Infrastructure.DomainEventCore 4 | { 5 | public abstract class DomainEvent : Infrastructure.DomainCore.AggregateRoot, IDomainEvent 6 | { 7 | public readonly DateTime OccurredOnTime; 8 | 9 | protected DomainEvent() 10 | { 11 | this.ID = Guid.NewGuid().ToString(); 12 | this.OccurredOnTime = DateTime.Now; 13 | this.IsRead = false; 14 | } 15 | 16 | public DateTime OccurredOn() 17 | { 18 | return this.OccurredOnTime; 19 | } 20 | 21 | public void Read() 22 | { 23 | this.IsRead = true; 24 | } 25 | 26 | public bool IsRead { get; private set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Mall.Infrastructure/DomainEventCore/DomainEventSubscriber.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Mall.Infrastructure.DomainEventCore 4 | { 5 | public abstract class DomainEventSubscriber : IDomainEventSubscriber where T : IDomainEvent 6 | { 7 | /// 订阅的事件类型 8 | /// 9 | /// 10 | public Type SubscribedToEventType() 11 | { 12 | return typeof(T); 13 | } 14 | 15 | public abstract void HandleEvent(T domainEvent); 16 | 17 | public void Handle(object domainEvent) 18 | { 19 | if (domainEvent is T) 20 | { 21 | this.HandleEvent((T)domainEvent); 22 | } 23 | else 24 | { 25 | throw new NotSupportedException(string.Format("当前订阅者支持的事件类型是:{0},当前事件是:{1}", typeof(T).FullName, domainEvent.GetType().FullName)); 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Mall.Infrastructure/DomainEventCore/IDomainEvent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Mall.Infrastructure.DomainEventCore 4 | { 5 | public interface IDomainEvent 6 | { 7 | DateTime OccurredOn(); 8 | 9 | /// 10 | /// 设置为已读 11 | /// 12 | /// 13 | void Read(); 14 | 15 | /// 16 | /// 是否已读 17 | /// 18 | bool IsRead { get; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Mall.Infrastructure/DomainEventCore/IDomainEventSubscriber.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Mall.Infrastructure.DomainEventCore 4 | { 5 | public interface IDomainEventSubscriber 6 | { 7 | Type SubscribedToEventType(); 8 | 9 | void Handle(object domainEvent); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Mall.Infrastructure/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mall.Infrastructure")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Mall.Infrastructure")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("c599d304-325d-4df5-be31-51b88056852f")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Mall.Infrastructure/ResponseHandle/JsonResponseReader.cs: -------------------------------------------------------------------------------- 1 | namespace Mall.Infrastructure.ResponseHandle 2 | { 3 | public class JsonResponseReader 4 | { 5 | private readonly string _jsonData; 6 | public JsonResponseReader(string json) 7 | { 8 | this._jsonData = json; 9 | } 10 | 11 | public string GetString(string key) 12 | { 13 | return key; //TODO implement。 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Mall.Infrastructure/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Infrastructure/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /Mall.Infrastructure/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Infrastructure/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /Mall.Infrastructure/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Infrastructure/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /Mall.Infrastructure/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.Infrastructure/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /Mall.v12.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall.v12.suo -------------------------------------------------------------------------------- /Mall/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace Mall 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Mall/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Mall.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /Mall/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace Mall 9 | { 10 | public class MvcApplication : System.Web.HttpApplication 11 | { 12 | protected void Application_Start() 13 | { 14 | AreaRegistration.RegisterAllAreas(); 15 | RouteConfig.RegisterRoutes(RouteTable.Routes); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Mall/Mall.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | CurrentPage 10 | True 11 | False 12 | False 13 | False 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | True 23 | True 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Mall/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Mall")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Mall")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("0e180e7e-9505-494e-ac1a-ac5c787340d9")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Mall/Views/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 |
7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Mall/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /Mall/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /Mall/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Mall/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /Mall/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /Mall/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /Mall/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/Mall/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /Mall/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DDDDemo 2 | DDD设计一个电商网站 3 | -------------------------------------------------------------------------------- /TestResults/0573bd35-21b6-4f04-bcb2-81826ec3e28c/Administrator_DESKTOP-UO0JAKG 2016-12-08 06_21_51.coverage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/TestResults/0573bd35-21b6-4f04-bcb2-81826ec3e28c/Administrator_DESKTOP-UO0JAKG 2016-12-08 06_21_51.coverage -------------------------------------------------------------------------------- /UnitTest.Mall.Domain.SellingPrice/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("UnitTest.Mall.Domain.SellingPrice")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("UnitTest.Mall.Domain.SellingPrice")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("bcde58f5-67c4-4c66-8239-aafbaa0412ac")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /UnitTest.Mall.Domain.SellingPrice/UnitTest.Mall.Domain.SellingPrice.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ShowAllFiles 5 | 6 | -------------------------------------------------------------------------------- /UnitTest.Mall.Domain.SellingPrice/UnitTest_PromotionRuleLimitTimeDiscount.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mall.Domain.SellingPrice.Promotion.Aggregate; 3 | using Microsoft.VisualStudio.TestTools.UnitTesting; 4 | 5 | namespace UnitTest.Mall.Domain.SellingPrice 6 | { 7 | [TestClass] 8 | public class UnitTest_PromotionRuleLimitTimeDiscount 9 | { 10 | [TestMethod] 11 | public void CalculateReducePrice_NotExistProductId_ReducePriceZero() 12 | { 13 | var promotion = new PromotionRuleLimitTimeDiscount("promotionId", "title", "productId", "productName", new DateTime(2016, 11, 11), new DateTime(2016, 11, 13), 10); 14 | 15 | var reducePrice = promotion.CalculateReducePrice("productId1", 100, DateTime.Now); 16 | Assert.AreEqual(0, reducePrice); 17 | } 18 | 19 | [TestMethod] 20 | public void CalculateReducePrice_ExistProductIdInvalidDateTime_ReducePriceZero() 21 | { 22 | var promotion = new PromotionRuleLimitTimeDiscount("promotionId", "title", "productId", "productName", new DateTime(2016, 11, 11), new DateTime(2016, 11, 13), 10); 23 | var reducePrice = promotion.CalculateReducePrice("productId", 100, new DateTime(2016, 11, 10)); 24 | Assert.AreEqual(0, reducePrice); 25 | } 26 | 27 | [TestMethod] 28 | public void CalculateReducePrice_ExistProductIdValidDateTime_ReducePriceZero() 29 | { 30 | const decimal ORIGINAL_PRICE = 100; 31 | const decimal DISCOUNTED_PRICE = 10; 32 | var promotion = new PromotionRuleLimitTimeDiscount("promotionId", "title", "productId", "productName", new DateTime(2016, 11, 11), new DateTime(2016, 11, 13), DISCOUNTED_PRICE); 33 | var reducePrice = promotion.CalculateReducePrice("productId", ORIGINAL_PRICE, new DateTime(2016, 11, 12)); 34 | Assert.AreEqual(ORIGINAL_PRICE - DISCOUNTED_PRICE, reducePrice); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /UnitTest.Mall.Domain.SellingPrice/UnitTest_RoleDiscountRelation.cs: -------------------------------------------------------------------------------- 1 | using Mall.Domain.SellingPrice.MemberPrice.ValueObject; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | 4 | namespace UnitTest.Mall.Domain.SellingPrice 5 | { 6 | [TestClass] 7 | public class UnitTest_RoleDiscountRelation 8 | { 9 | [TestMethod] 10 | public void CalculateDiscountedPrice_DiscountRateTenPercentOff_Success() 11 | { 12 | const decimal ORIGINAL_PRICE = 100; 13 | var relation = new RoleDiscountRelation("roleId", "roleName", 0.9f); 14 | 15 | var reducePrice = relation.CalculateDiscountedPrice(ORIGINAL_PRICE); 16 | Assert.AreEqual(10, reducePrice); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /UnitTest.Mall.Domain.SellingPrice/UnitTest_SingleProductPromotionRule.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mall.Domain.SellingPrice.Promotion.Aggregate; 3 | using Microsoft.VisualStudio.TestTools.UnitTesting; 4 | 5 | namespace UnitTest.Mall.Domain.SellingPrice 6 | { 7 | [TestClass] 8 | public class UnitTest_SingleProductPromotionRule 9 | { 10 | [TestMethod] 11 | public void IsExistedProduct_SameProductId_Success() 12 | { 13 | var promotionRule = (SingleProductPromotionRule)new PromotionRuleLimitTimeDiscount("promotionId", "title", "productId", "title", new DateTime(2000, 1, 1), new DateTime(2000, 1, 10), 10); 14 | 15 | var product = promotionRule.GetPromotionContainsProduct(); 16 | Assert.AreNotEqual(null, product); 17 | Assert.AreEqual(true, promotionRule.IsExistedProduct("productId")); 18 | } 19 | 20 | [TestMethod] 21 | public void IsExistedProduct_DifferentProductId_Failure() 22 | { 23 | var promotionRule = (SingleProductPromotionRule)new PromotionRuleLimitTimeDiscount("promotionId", "title", "productId", "title", new DateTime(2000, 1, 1), new DateTime(2000, 1, 10), 10); 24 | 25 | var product = promotionRule.GetPromotionContainsProduct(); 26 | Assert.AreNotEqual(null, product); 27 | Assert.AreEqual(false, promotionRule.IsExistedProduct("productId2")); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /UnitTest.Mall.Domain.SellingPrice/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/UnitTest.Mall.Domain.SellingPrice/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /UnitTest.Mall.Domain.SellingPrice/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/UnitTest.Mall.Domain.SellingPrice/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /UnitTest.Mall.Domain.SellingPrice/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/UnitTest.Mall.Domain.SellingPrice/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /UnitTest.Mall.Domain.SellingPrice/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/UnitTest.Mall.Domain.SellingPrice/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /UnitTest.Mall.Domain/FavoritesItemTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Mall.Domain.FavoritesModule.Entity; 3 | using Microsoft.VisualStudio.TestTools.UnitTesting; 4 | 5 | namespace UnitTest.Mall.Domain 6 | { 7 | [TestClass] 8 | public class FavoritesItemTest 9 | { 10 | [TestMethod] 11 | [ExpectedException(typeof(ArgumentNullException))] 12 | public void Constructor_IdDefault_ThrowArgumentNullException() 13 | { 14 | var favoritesItem = new FavoritesItem(default(string), DateTime.Now); 15 | Assert.AreNotEqual(null, favoritesItem); 16 | } 17 | 18 | [TestMethod] 19 | [ExpectedException(typeof(ArgumentException))] 20 | public void Constructor_FavoriteTimeDefault_ThrowArgumentNullException() 21 | { 22 | var favoritesItem = new FavoritesItem("id", default(DateTime)); 23 | Assert.AreNotEqual(null, favoritesItem); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /UnitTest.Mall.Domain/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("UnitTest.Mall.Domain")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("UnitTest.Mall.Domain")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("f057ec26-6b47-4eb0-a516-9d08f2f8bd4b")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /UnitTest.Mall.Domain/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/UnitTest.Mall.Domain/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /UnitTest.Mall.Domain/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/UnitTest.Mall.Domain/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs -------------------------------------------------------------------------------- /UnitTest.Mall.Domain/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/UnitTest.Mall.Domain/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs -------------------------------------------------------------------------------- /UnitTest.Mall.Domain/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/UnitTest.Mall.Domain/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.Mvc.5.2.3/Content/Web.config.install.xdt: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.Mvc.5.2.3/Content/Web.config.uninstall.xdt: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.Mvc.5.2.3/Microsoft.AspNet.Mvc.5.2.3.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/packages/Microsoft.AspNet.Mvc.5.2.3/Microsoft.AspNet.Mvc.5.2.3.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.Mvc.5.2.3/lib/net45/System.Web.Mvc.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/packages/Microsoft.AspNet.Mvc.5.2.3/lib/net45/System.Web.Mvc.dll -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.Razor.3.2.3/Microsoft.AspNet.Razor.3.2.3.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/packages/Microsoft.AspNet.Razor.3.2.3/Microsoft.AspNet.Razor.3.2.3.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.Razor.3.2.3/lib/net45/System.Web.Razor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/packages/Microsoft.AspNet.Razor.3.2.3/lib/net45/System.Web.Razor.dll -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebPages.3.2.3/Content/Web.config.install.xdt: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebPages.3.2.3/Content/Web.config.uninstall.xdt: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 7 | 8 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebPages.3.2.3/Microsoft.AspNet.WebPages.3.2.3.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/packages/Microsoft.AspNet.WebPages.3.2.3/Microsoft.AspNet.WebPages.3.2.3.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebPages.3.2.3/lib/net45/System.Web.Helpers.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/packages/Microsoft.AspNet.WebPages.3.2.3/lib/net45/System.Web.Helpers.dll -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebPages.3.2.3/lib/net45/System.Web.WebPages.Deployment.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/packages/Microsoft.AspNet.WebPages.3.2.3/lib/net45/System.Web.WebPages.Deployment.dll -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebPages.3.2.3/lib/net45/System.Web.WebPages.Razor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/packages/Microsoft.AspNet.WebPages.3.2.3/lib/net45/System.Web.WebPages.Razor.dll -------------------------------------------------------------------------------- /packages/Microsoft.AspNet.WebPages.3.2.3/lib/net45/System.Web.WebPages.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/packages/Microsoft.AspNet.WebPages.3.2.3/lib/net45/System.Web.WebPages.dll -------------------------------------------------------------------------------- /packages/Microsoft.Web.Infrastructure.1.0.0.0/Microsoft.Web.Infrastructure.1.0.0.0.nupkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/packages/Microsoft.Web.Infrastructure.1.0.0.0/Microsoft.Web.Infrastructure.1.0.0.0.nupkg -------------------------------------------------------------------------------- /packages/Microsoft.Web.Infrastructure.1.0.0.0/lib/net40/Microsoft.Web.Infrastructure.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZacharyFan/DDDDemo/d6fd769a91ba312646ee71f088abe5f57813a482/packages/Microsoft.Web.Infrastructure.1.0.0.0/lib/net40/Microsoft.Web.Infrastructure.dll -------------------------------------------------------------------------------- /packages/repositories.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | --------------------------------------------------------------------------------