/// <summary> /// Initializes <see cref="CarterOptions"/> /// </summary> /// <param name="before">A global before handler which is invoked before all routes</param> /// <param name="after">A global after handler which is invoked after all routes</param> /// <param name="openApiOptions">A <see cref="OpenApiOptions"/> instance to configure OpenApi</param> public CarterOptions(OpenApiOptions openApiOptions = null) { this.OpenApi = openApiOptions ?? new OpenApiOptions("Carter <3 OpenApi", Enumerable.Empty <string>(), new Dictionary <string, OpenApiSecurity>()); }
/// <summary> /// Initializes <see cref="CarterOptions"/> /// </summary> /// <param name="before">A global before handler which is invoked before all routes</param> /// <param name="after">A global after handler which is invoked after all routes</param> /// <param name="openApiOptions">A <see cref="OpenApiOptions"/> instance to configure OpenApi</param> public CarterOptions(Func <HttpContext, Task <bool> > before = null, Func <HttpContext, Task> after = null, OpenApiOptions openApiOptions = null) { this.Before = before; this.After = after; this.OpenApi = openApiOptions ?? new OpenApiOptions("Carter <3 OpenApi", Enumerable.Empty <string>(), new Dictionary <string, OpenApiSecurity>()); }
/// <summary> /// Initializes <see cref="CarterOptions"/> /// </summary> /// <param name="before">A global before handler which is invoked before all routes</param> /// <param name="after">A global after handler which is invoked after all routes</param> public CarterOptions(Func <HttpContext, Task <bool> > before = null, Func <HttpContext, Task> after = null, OpenApiOptions openApiOptions = null) { this.Before = before; this.After = after; this.OpenApi = openApiOptions ?? new OpenApiOptions(Enumerable.Empty <string>()); }