diff --git a/plugins/Inventories/DaprActors/src/EasyAbp.EShop.Plugins.Inventories.DaprActors/EasyAbp/EShop/Plugins/Inventories/DaprActors/InventoryActor.cs b/plugins/Inventories/DaprActors/src/EasyAbp.EShop.Plugins.Inventories.DaprActors/EasyAbp/EShop/Plugins/Inventories/DaprActors/InventoryActor.cs index a53e7c53..eb8e7345 100644 --- a/plugins/Inventories/DaprActors/src/EasyAbp.EShop.Plugins.Inventories.DaprActors/EasyAbp/EShop/Plugins/Inventories/DaprActors/InventoryActor.cs +++ b/plugins/Inventories/DaprActors/src/EasyAbp.EShop.Plugins.Inventories.DaprActors/EasyAbp/EShop/Plugins/Inventories/DaprActors/InventoryActor.cs @@ -6,18 +6,20 @@ namespace EasyAbp.EShop.Plugins.Inventories.DaprActors; public class InventoryActor : Actor, IInventoryActor { + public static string InventoryStateName { get; set; } = "i"; + public InventoryActor(ActorHost host) : base(host) { } protected override async Task OnActivateAsync() { - await StateManager.TryAddStateAsync(Id.GetId(), new InventoryStateModel()); + await StateManager.TryAddStateAsync(InventoryStateName, new InventoryStateModel()); } public virtual async Task GetInventoryStateAsync() { - return await StateManager.GetStateAsync(Id.GetId()); + return await StateManager.GetStateAsync(InventoryStateName); } public virtual async Task IncreaseInventoryAsync(int quantity, bool decreaseSold)