MVCCaching.Kentico.Core 13.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package MVCCaching.Kentico.Core --version 13.0.0                
NuGet\Install-Package MVCCaching.Kentico.Core -Version 13.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MVCCaching.Kentico.Core" Version="13.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MVCCaching.Kentico.Core --version 13.0.0                
#r "nuget: MVCCaching.Kentico.Core, 13.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MVCCaching.Kentico.Core as a Cake Addin
#addin nuget:?package=MVCCaching.Kentico.Core&version=13.0.0

// Install MVCCaching.Kentico.Core as a Cake Tool
#tool nuget:?package=MVCCaching.Kentico.Core&version=13.0.0                

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.

Kentico 13 MVC.Net Core Installation

  1. 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.

  2. 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>();
                });
    }
  1. 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
        }
  1. Add these 2 methods to your Startup Class:
public IConfigurationRoot Configuration { get; private set; }
public ILifetimeScope AutofacContainer { get; private set; }
  1. Make sure for your Startup.ConfigureServices you have services.AddOptions(); called
  2. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
13.0.3 6,522 9/6/2022 13.0.3 is deprecated because it is no longer maintained.
13.0.2 21,234 3/12/2021
13.0.0 2,459 11/13/2020

Initial Release