mirror of https://github.com/EasyAbp/EShop.git
2 changed files with 41 additions and 1 deletions
@ -0,0 +1,38 @@ |
|||
# EShop.Plugins.Inventories.DaprActors |
|||
|
|||
[](https://abp.io) |
|||
[](https://www.nuget.org/packages/EasyAbp.EShop.Plugins.Inventories.DaprActors.Abstractions) |
|||
[](https://www.nuget.org/packages/EasyAbp.EShop.Plugins.Inventories.DaprActors.Abstractions) |
|||
[](https://discord.gg/S6QaezrCRq) |
|||
[](https://www.github.com/EasyAbp/EShop) |
|||
|
|||
EShop product-inventory implementation of [Dapr Actors](https://docs.dapr.io/developing-applications/building-blocks/actors/actors-overview). |
|||
|
|||
## Installation |
|||
|
|||
1. Install the following NuGet packages. ([see how](https://github.com/EasyAbp/EasyAbpGuide/blob/master/docs/How-To.md#add-nuget-packages)) |
|||
|
|||
* EasyAbp.EShop.Products.DaprActorsInventory.Domain _(install at EasyAbp.EShop.Products.Domain location)_ |
|||
* EasyAbp.EShop.Plugins.Inventories.DaprActors.AspNetCore _(install at a host project to run Actors)_ |
|||
|
|||
2. Add `DependsOn(typeof(EShopXxxModule))` attribute to configure the module dependencies. ([see how](https://github.com/EasyAbp/EasyAbpGuide/blob/master/docs/How-To.md#add-module-dependencies)) |
|||
|
|||
## Usage |
|||
|
|||
1. Configure the DaprActors inventory provider as default. |
|||
```csharp |
|||
Configure<EShopProductsOptions>(options => |
|||
{ |
|||
// Configure as the default inventory provider |
|||
options.DefaultInventoryProviderName = "DaprActors"; |
|||
|
|||
// Configure as the default inventory provider for MyProductGroup |
|||
options.Groups.Configure<MyProductGroup>(group => |
|||
{ |
|||
group.DefaultInventoryProviderName = "DaprActors"; |
|||
}); |
|||
}); |
|||
``` |
|||
> Better to use `DaprActorsProductInventoryProvider.DaprActorsProductInventoryProviderName` instead of `"DaprActors"` as the provider name. |
|||
|
|||
2. Create a product and set `InventoryProviderName` to `DaprActors`. Then the product is specified to use the Dapr Actors inventory provider. |
|||
Loading…
Reference in new issue