MVCCaching.Kentico.Core
13.0.2
See the version list below for details.
dotnet add package MVCCaching.Kentico.Core --version 13.0.2
NuGet\Install-Package MVCCaching.Kentico.Core -Version 13.0.2
<PackageReference Include="MVCCaching.Kentico.Core" Version="13.0.2" />
paket add MVCCaching.Kentico.Core --version 13.0.2
#r "nuget: MVCCaching.Kentico.Core, 13.0.2"
// Install MVCCaching.Kentico.Core as a Cake Addin #addin nuget:?package=MVCCaching.Kentico.Core&version=13.0.2 // Install MVCCaching.Kentico.Core as a Cake Tool #tool nuget:?package=MVCCaching.Kentico.Core&version=13.0.2
MVC Caching
MVC Caching for Kentico MVC, allows for easy Caching and hookup of Repository calls through IRepository
, IService
, and attributes found in the MVCCaching namespace. Sets up and leverages Kentico's cache dependencies.
Also tracks all Dependencies called to the ICacheDependenciesStore
automatically, and you can leverage ICacheDependenciesScope.Begin()
and string[] ICacheDependenciesScope.End()
to begin and end tracking of dependencies in order to compile all dependencies between the begin and end.
Kentico 13 MVC.Net Core Installation
Install the Nuget Package
MVCCaching.Kentico.Core
on your MVC.Net Core application. Note due to the complexity of invocation decoration, this package does depend on Castle Windsor and Autofac.On your Main method (usually Program.cs), to the HostBuilder, add .UserServiceProviderFactory(new AutofacServiceProviderFactory()) example:
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
// THIS ONE LINE BELOW NEEDED:
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
- On your Startup Class Constructor method, add the following:
public Startup(IWebHostEnvironment environment)
{
Environment = environment;
// MVC Caching
var builder = new ConfigurationBuilder()
.SetBasePath(environment.ContentRootPath)
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddJsonFile($"appsettings.{environment.EnvironmentName}.json", optional: true)
.AddEnvironmentVariables();
this.Configuration = builder.Build();
// END MVC Caching
}
- Add these 2 methods to your Startup Class:
public IConfigurationRoot Configuration { get; private set; }
public ILifetimeScope AutofacContainer { get; private set; }
- Make sure for your Startup.ConfigureServices you have
services.AddOptions();
called - Add the following method to your Startup Class
// MVC Caching
public void ConfigureContainer(ContainerBuilder builder)
{
DependencyResolverConfig.Register(builder, new Assembly[] { typeof(Startup).Assembly });
}
These steps hook up Autofac and MVC Caching.
NOTE: The "string currentCulture" and "bool previewEnabled" have been replaced with IRepoContext
which you can leverage to retrieve these values.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.1 is compatible. |
-
.NETCoreApp 3.1
- Autofac.Extensions.DependencyInjection (>= 7.1.0)
- Autofac.Extras.DynamicProxy (>= 6.0.0)
- Castle.Core (>= 4.4.1)
- Kentico.Xperience.AspNetCore.WebApp (>= 13.0.0)
- MVCCaching.Base.Core (>= 2.1.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Added ICacheDependenciesStore and ICacheDependenciesScope integration.