VOOZH about

URL: https://docs.revoframework.net/reference-guide/configuration

⇱ Configuration and boostrapping | Revo Framework


For the complete documentation index, see llms.txt. This page is also available as Markdown.

Configuration

Apart from the usual possibility to specify many run-time parameters in a dynamic manner (such as loading database connection strings from configuration files), many aspects of the framework can only be altered using the programmatic configuration API. This configuration is represented by an instance of IRevoConfiguration , which itself is only a container for a number of IRevoConfigurationSection sections. When done building the configuration, the framework bootstraps the application using the parameters provided.

Examples

Typically, the configuration object would be created at an application entry point and then configured as neccessary using fluent-style extension methods.

ASP.NET Core

To easily bootstrap a Revo in an ASP.NET core application, simply inherit your Startup class from the RevoStartup base class and override the CreateRevoConfiguration method.

Example:

publicclassStartup:RevoStartup
{
publicStartup(IConfigurationconfiguration):base(configuration)
{
}
publicoverridevoidConfigureServices(IServiceCollectionservices)
{
base.ConfigureServices(services);
 // TODO configure your services
}
publicoverridevoidConfigure(IApplicationBuilderapp,IHostingEnvironmentenv,ILoggerFactoryloggerFactory)
{
base.Configure(app,env,loggerFactory);
 // TODO configure your ASP.NET core app, e.g.:
app.UseMvcWithDefaultRoute();
}
protectedoverrideIRevoConfigurationCreateRevoConfiguration()
{
stringconnectionString=Configuration.GetConnectionString("TodosPostgreSQL");
returnnewRevoConfiguration()
.UseAspNetCore()
.UseEFCoreDataAccess(contextBuilder=>contextBuilder.UseNpgsql(connectionString))
.UseAllEFCoreInfrastructure();
}
}

ASP.NET

In ASP.NET applications, this would be the inside a RevoHttpApplication, e.g.:

Last updated

public class MvcApplication : RevoHttpApplication
{
 protected override IRevoConfiguration CreateRevoConfiguration()
 {
 return new RevoConfiguration()
 .UseAspNet()
 .UseEF6DataAccess(useAsPrimaryRepository: true, connection: new EF6ConnectionConfiguration("EntityContext"))
 .UseAllEF6Infrastructure()
 .UseHangfire();
 }
}