Owin: how to pass arguments to my own startup class? -


I am trying to develop a web API self-hosting app using OVIN in my XyzStartup class, Argument is required: contentFolderPath.

However, I could not find any way to pass this argument. Here's my code:

  var contentFolderPath = this.TextBox.Text; // user input var startOptions = new initial option (); (Style Content FolderPath) {... (Start Control FolderPath) {... (Start Controller Folder)}}   

I saw a startup class, but how to use it. I can already use it in my XyzStartup class

thanks


I finally find a way to do this ?!

  on StartOptions = new initial option (); StartOptions.Urls.Add ('.. some url ..'); WebApp.Start (startOptions, (appBuilder) = & gt; {New XyzStartup (contentFolderPath) .Configuration (appBuilder);}    

If you want to pass the parameter to the startup category, you can use the action in the WebApp.Start in Cilliƃ © Malan's As a result, your mention in the comment, rather than starting with the type parameter ( WebApp.Start & lt; t & gt; )

Here is a solid example for self hosted: < / P>

  object on someThingYouWantToAccess; Server = WebApp. (" Http: // localhost: 8080 / "start, (appbuilder) => gtc: // // you can manually configure someThingYouWantToAccess // here for the host. Http configconf = config = new.httpConfiguration (); config.MapHttpAttributeRoutes () ;; Config.routes.MapHttpRoute (name: "DefaultApi", routeTemplate: "API / {controller} / {ID}", default: new {id = RouteParameter.Optional}); appBuilder.UseWebApi (config);});    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -