- .NET Core v5 and later
- An ASP.NET Core MVC project
- Package Manager: PM> Install-Package Inertia.AspNetCore
- .NET CLI: dotnet add package Inertia.AspNetCore
- Setup Startup.cs
using Inertia.AspNetCore;
public void ConfigureServices(IServiceCollection services)
{
services.AddControllersWithViews().AddInertia();
}
- In your controller
using Inertia.AspNetCore;
public class HomeController : InertiaController {
public IActionResult Index()
{
return Inertia("Index", new
{
UserId = 1
});
}
}
Visit inertiajs.com to learn more.