Hw to pass arguments to my own Startup class?

If you want to pass parameter to StartUp class, you can use Action<IAppBuilder> in WebApp.Start like CilliƩ Malan mentioned in the comment instead of launching with Type parameter(WebApp.Start<T>)

Here is a concrete example for self-hosting:

object someThingYouWantToAccess;
var server = WebApp.Start("http://localhost:8080/", (appBuilder) =>
{
    // You can access someThingYouWantToAccess here

    // Configure Web API for self-host.
    HttpConfiguration config = new HttpConfiguration();
    config.MapHttpAttributeRoutes();
    config.Routes.MapHttpRoute(
        name: "DefaultApi",
        routeTemplate: "api/{controller}/{id}",
        defaults: new { id = RouteParameter.Optional }
    );
    appBuilder.UseWebApi(config);
});

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)