Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
60 lines (29 sloc) 2.8 KB

While this topic dives into some of the more general options available in JasperRegistry, check out these topics for deeper discussions of setting up Jasper applications:

  • <[linkto:documentation/bootstrapping/configuration]> for integrating with Configuration in .Net Core and Jasper's strong-typed configuration Settings model
  • <[linkto:documentation/bootstrapping/aspnetcore]> to make Jasper act as just a citizen in the greater ASP.Net Core ecosystem
  • <[linkto:documentation/http]> for information on configuring ASP.Net Core middleware and customizing Jasper's HTTP service support
  • <[linkto:documentation/messaging]> for setting up messaging receivers, subscriptions, and publishing in your application

Service Name

By default, Jasper derives a descriptive ServiceName for your application by taking the class name of your JasperRegistry and stripping off any "JasperRegistry" or "Registry" suffix. For diagnostic purposes you may want to override the service name like so:

<[sample:CustomServiceRegistry]>

Hosting Environment

Jasper exposes the ASP.Net Core Environment name with this usage:

<[sample:EnvironmentNameRegistry]>

You can use the EnvironmentName property within the constructor function of your JasperRegistry to do conditional configuration based on environment just like you would in an ASP.Net Core application:

<[sample:UsingEnvironmentName]>

You can also access the current application directory and other information from the IHostedEnvironment property on the context object in both signatures.

Service Registrations

Note! Jasper was conceived and designed in no small part to reduce the role of an IoC container at runtime, but "much, much less" is still more than "none."

Like most application frameworks in .Net, Jasper uses an IoC container to do basic composition within its runtime pipeline. You can add your own registrations to the application container directly in your JasperRegistry:

<[sample:Bootstrapping-ServiceRegistrations]>

See <[linkto:documentation/ioc]> for a lot more information about how Jasper uses an IoC container.

Adding Extensions

Jasper comes with its own extensibility model based on an interface called IJasperExtension. A custom extension might look something like this:

<[sample:Bootstrapping-CustomJasperExtension]>

The syntax in JasperRegistry to apply that extension is shown below:

<[sample:AppWithExtensions]>

See <[linkto:documentation/extensions]> for more information on building, using, and auto-discovering Jasper extensions.