Skip to content

Commit

Permalink
problem described in kontent-ai/delivery-sdk-net#265
Browse files Browse the repository at this point in the history
  • Loading branch information
petrsvihlik committed Feb 7, 2021
1 parent be8cae9 commit 6d27c22
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
6 changes: 4 additions & 2 deletions DancingGoat/DancingGoat.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" />
<PackageReference Include="Kentico.AspNetCore.LocalizedRouting" Version="1.0.0-beta2" />
<PackageReference Include="Kentico.Kontent.AspNetCore" Version="0.0.9" />
<PackageReference Include="Kentico.Kontent.Delivery.Extensions.DependencyInjection" Version="15.0.0-alpha2" />
<PackageReference Include="Kentico.Kontent.Delivery.Caching" Version="15.0.0-alpha3" />
<PackageReference Include="Kentico.Kontent.Delivery.Extensions.DependencyInjection" Version="15.0.0-alpha3" />
<PackageReference Include="Kentico.Kontent.Management.Helpers" Version="2.1.1-beta1" />
<PackageReference Include="Kentico.Kontent.Delivery" Version="15.0.0-alpha2" />
<PackageReference Include="Kentico.Kontent.Delivery" Version="15.0.0-alpha3" />
<PackageReference Include="Kentico.Kontent.Recommender" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.1" />
<PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="2.1.113" />
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
</ItemGroup>
Expand Down
14 changes: 14 additions & 0 deletions DancingGoat/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
using Microsoft.Extensions.Hosting;
using Serilog;
using static DancingGoat.Configuration.Constants;
using Kentico.Kontent.Delivery.Caching;
using Kentico.Kontent.Delivery.Caching.Extensions;

namespace DancingGoat
{
Expand Down Expand Up @@ -48,6 +50,18 @@ public void ConfigureServices(IServiceCollection services)
services.AddSingleton<IContentLinkUrlResolver, CustomContentLinkUrlResolver>();
services.AddDeliveryClient(Configuration);

services.AddStackExchangeRedisCache(options =>
{
options.Configuration = "localhost";
options.InstanceName = "SampleInstance";
});

// Use cached client decorator
services.AddDeliveryClientCache(new DeliveryCacheOptions()
{
CacheType = CacheTypeEnum.Distributed
});

// Register a second client for the configuration wizard
services.AddDeliveryClient(ReferenceClient, Configuration, $"{nameof(AppConfiguration)}:{nameof(DeliveryOptions)}", NamedServiceProviderType.Autofac);

Expand Down

0 comments on commit 6d27c22

Please sign in to comment.