src/packages/EmbedIO/WebModuleContainerExtensions-Cors.cs
/// <summary>
/// Creates an instance of <see cref="CorsModule"/> and adds it to a module container.
/// </summary>
/// <typeparam name="TContainer">The type of the module container.</typeparam>
/// <param name="this">The <typeparamref name="TContainer"/> on which this method is called.</param>
/// <param name="baseRoute">The base route of the module.</param>
/// <param name="origins">The valid origins. Default is <c>"*"</c>, meaning all origins.</param>
/// <param name="headers">The valid headers. Default is <c>"*"</c>, meaning all headers.</param>
/// <param name="methods">The valid method. Default is <c>"*"</c>, meaning all methods.</param>
/// <returns><paramref name="this"/> with a <see cref="CorsModule"/> added.</returns>
/// <exception cref="NullReferenceException"><paramref name="this"/> is <see langword="null"/>.</exception>
/// <seealso cref="CorsModule"/>
Creates an instance of  and adds it to a module container.
Creates an instance of and adds it to a module container .
public static TContainer WithCors<TContainer>(
            this TContainer @this,
            string baseRoute,
            string origins,
            string headers,
            string methods)
            where TContainer : class, IWebModuleContainer
        {
            @this.Modules.Add(new CorsModule(baseRoute, origins, headers, methods));
            return @this;
        }
public static TContainer WithCors < TContainer > ( this TContainer @this , string baseRoute , string origins , string headers , string methods ) where TContainer : class , IWebModuleContainer { @this . Modules . Add ( new CorsModule ( baseRoute , origins , headers , methods ) ) ; return @this ; }
Creates an instance of  and adds it to a module container.
Creates an instance of and adds it to a module container .
with a  added.
with a added .
None
TContainer
this
baseRoute
string
The base route of the module.
The base route of the module .
origins
string
The valid origins. Default is "*"
The valid origins . Default is " * "
headers
string
The valid headers. Default is "*"
The valid headers . Default is " * "
methods
string
The valid method. Default is "*"
The valid method . Default is " * "
this
The  on which this method is called.
The on which this method is called .
typeparam
The type of the module container.
The type of the module container .
seealso
None