Skip to content

Latest commit

 

History

33 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Imp

Build NuGet

Imp (In Memory Pages) is a lightweight page framework built on ASP.NET Core middleware. It maps request paths to .NET classes, creates pages through dependency injection, binds query-string values to page properties, and renders responses directly or through embedded XML templates.

Imp supports the actively maintained .NET 8 and .NET 10 LTS releases.

The idea in one example

Given this page class:

using System.Text.Encodings.Web;
using System.Threading.Tasks;
using Imp;
using Microsoft.AspNetCore.Http;

namespace MySite.Pages;

public sealed class Hello : BasePage
{
   public string Name { get; set; } = "World";

   public override Task Render(HttpResponse response)
   {
      string name = HtmlEncoder.Default.Encode(Name);
      return response.WriteAsync($"<h1>Hello, {name}!</h1>");
   }
}

Imp maps the request:

/hello?Name=Mike

to MySite.Pages.Hello, binds Mike to its Name property, and renders:

<h1>Hello, Mike!</h1>

That is Imp's central model: URL paths map to page classes, and query-string parameters map to public writable properties. Query-property names are case-sensitive, so this example uses Name, not name.

Get started

Install the package:

dotnet add package KitchenPC.Imp

Then follow the Wiki's Getting Started guide to configure the middleware and create your first page.

For a complete working application, see the Todo sample or read its guided tour.

Documentation

The Imp Wiki contains the complete developer guide:

Build and test

From the repository root:

dotnet test

To create local NuGet and symbol packages:

dotnet pack src/Imp/Imp.csproj --configuration Release --output artifacts

See Build, Package, and Contribute for repository structure, release details, and contribution guidance.

License

Imp is available under the MIT License.

About

In-Memory Pages web framework for ASP.NET

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages