src/packages/EmbedIO/Routing/RouteResolverBase`1.cs
/// <summary>
/// <para>Associates some data to a synchronous handler.</para>
/// <para>The <see cref="ResolveAsync"/> method calls <see cref="GetContextData"/>
/// to extract data from the context; then, for each registered data / handler pair,
/// <see cref="MatchContextData"/> is called to determine whether <paramref name="handler"/>
/// should be called.</para>
/// </summary>
/// <param name="data">Data used to determine which contexts are
/// suitable to be handled by <paramref name="handler"/>.</param>
/// <param name="handler">A callback used to handle matching contexts.</param>
/// <exception cref="ArgumentNullException"><paramref name="handler"/> is <see langword="null"/>.</exception>
/// <seealso cref="RouteHandlerCallback"/>
/// <seealso cref="ResolveAsync"/>
/// <seealso cref="GetContextData"/>
/// <seealso cref="MatchContextData"/>
Associates some data to a synchronous handler.The  method calls
to extract data from the context; then, for each registered data / handler pair,
is called to determine whether
should be called.
Associates some data to a synchronous handler . The method calls to extract data from the context ; then for each registered data / handler pair is called to determine whether should be called .
public void Add(TData data, SyncRouteHandlerCallback handler)
        {
            EnsureConfigurationNotLocked();
            handler = Validate.NotNull(nameof(handler), handler);
            _dataHandlerPairs.Add((data, (ctx, route) =>
            {
                handler(ctx, route);
                return Task.CompletedTask;
            }));
        }
public void Add ( TData data , SyncRouteHandlerCallback handler ) { EnsureConfigurationNotLocked ( ) ; handler = Validate . NotNull ( nameof ( handler ) , handler ) ; _dataHandlerPairs . Add ( ( data , ( ctx , route ) => { handler ( ctx , route ) ; return Task . CompletedTask ; } ) ) ; }
Associates some data to a synchronous handler.The  method calls
to extract data from the context; then, for each registered data / handler pair,
is called to determine whether
should be called.
Associates some data to a synchronous handler . The method calls to extract data from the context ; then for each registered data / handler pair is called to determine whether should be called .
None
data
TData
Data used to determine which contexts are
suitable to be handled by .
Data used to determine which contexts are suitable to be handled by .
handler
SyncRouteHandlerCallback
A callback used to handle matching contexts.
A callback used to handle matching contexts .
seealso
None
seealso
None
seealso
None
seealso
None