An abp application module group that provides basic e-shop service.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2.9 KiB

EShop.Plugins.Inventories.OrleansGrains

ABP version NuGet NuGet Download Discord online GitHub stars

EShop product-inventory implementation of Orleans Grains.

Installation

  1. Install the following NuGet packages. (see how)

    • EasyAbp.EShop.Products.OrleansGrainsInventory.Domain (install at EasyAbp.EShop.Products.Domain location)
    • EasyAbp.EShop.Plugins.Inventories.OrleansGrains.Silo (install at a host project to run Grains)
  2. Add DependsOn(typeof(EShopXxxModule)) attribute to configure the module dependencies. (see how)

  3. Open Program.cs in the host project to create an Orleans Silo. (see Microsoft's document for more information)

    builder.Host.AddAppSettingsSecretsJson()
        .UseAutofac()
        .UseSerilog()
        .UseOrleans(c =>
        {
            c.UseLocalhostClustering()   // for test only
            c.AddMemoryGrainStorage(InventoryGrain.StorageProviderName);   // for test only
        });
    

Usage

  1. Configure the OrleansGrains inventory provider as default.

    Configure<EShopProductsOptions>(options =>
    {
        // Configure as the default inventory provider
        options.DefaultInventoryProviderName = "OrleansGrains";
    
        // Configure as the default inventory provider for MyProductGroup
        options.Groups.Configure<MyProductGroup>(group =>
        {
            group.DefaultInventoryProviderName = "OrleansGrains";
        });
    });
    

    Better to use OrleansGrainsProductInventoryProvider.OrleansGrainsProductInventoryProviderName instead of "OrleansGrains" as the provider name.

  2. Create a product and set InventoryProviderName to OrleansGrains. Then the product is specified to use the Orleans Grains inventory provider.