How to Configure Agility SDK Packages

Setup Agility Fetch API (Access Content)

1. Download the Nuget package Agility Fetch API

2. Import required packages in Startup.cs

using Agility.NET.FetchAPI.Helpers;
using Agility.NET.FetchAPI.Services;

2.  Add FetchApiService to ConfigureServices in Startup.cs

services.AddHttpClient<FetchApiService>();

Dependencies

Agility Fetch API does not have a dependency on Agility Core and can be used without. Agility Core package both Pagement Management and URL Redirects are dependant on Agility Fetch API.

Setup Agility Core (Manage Pages)

Use Agility Page Management

1. Download the Nuget package Agility Core

2. Import required packages in Startup.cs

using Agility.NET.Core.Domain;

2.  Add AgilityRouteTransformer to ConfigureServices in Startup.cs

services.AddSingleton<AgilityRouteTransformer>();

3. Add UseEndpoints to Configure in Startup.cs

app.UseEndpoints(endpoints =>
{
  endpoints.MapRazorPages();
  endpoints.MapDynamicPageRoute<AgilityRouteTransformer>("/{**slug}");
});

Use Agility URL Redirects (Server Side)

1. Download the Nuget package Agility Core

2. Import required packages in Startup.cs

using Agility.NET.Core.Domain;

3. Add AgilityRedirectMiddleware to Configure in Startup.cs

app.UseMiddleware<AgilityRedirectMiddleware>();

You can use Page Management with Agility URL Redirects or implement your own Middleware.