Backend Configuration

The Startup.cs file contains all the configuration for the backend.

//---------------------------------------------------------------------------------------------
//BQ Start related
//---------------------------------------------------------------------------------------------
services.AddBqAdminServices<ApplicationUser, MainDataContext>(options =>
    options.SetApplicationName("myapp bqStart")
    //allow open user registrations
    .SetAllowUserRegistration(false)
    //change default timezone
    .SetDefaultTimeZone(TZConvert.GetTimeZoneInfo("UTC"))
    //change default language
    .SetDefaultLanguage("en_AU")
    .SetSecurityRulesProvider(new FileBasedSecurityRulesProvider("config"))
    //register all OData controllers here
    .RegisterController<IdentityRole, IdentityRoleController>()
    .RegisterController<ApplicationUser, ApplicationUserController>()
    .RegisterController<DemoCustomer, DemoCustomerController>()
    );

The AddBqAdminServices service extension allows you to set up the details of the application.

  • SetApplicationName - This will show the application in the user management section of the Identity area.

  • SetAllowUserRegistration - If true then users can register in the login section.

  • SetDefaultTimeZone - Set the current default timezone. When a new user is created this value is used.

  • SetDefaultLanguage - Current language setup

  • SetSecurityRulesProvider - This option will let you specify which provider is responsible for security access rules. The provider must implement ISecurityRulesProvider. FileBasedSecurityRulesProvider manages the rules in an XMLxml file and comes in the package library by default.

  • RegisterController - You need to register all your OData controllers via this option. Behind the scene the

Last updated