You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Builder for mapping interface methods to implementations.
publicsealedclass Builder
Methods
Method
Returns
Description
Map<TResult>(selector, handler)
Builder
Map zero-parameter method
Map<T1, TResult>(selector, handler)
Builder
Map one-parameter method
Map<T1, T2, TResult>(selector, handler)
Builder
Map two-parameter method
Map<T1, T2, T3, TResult>(selector, handler)
Builder
Map three-parameter method
Map<T1, T2, T3, T4, TResult>(selector, handler)
Builder
Map four-parameter method
Build()
TFacadeInterface
Build facade implementing interface
Method Signatures
// Zero parameterspublicBuilderMap<TResult>(Expression<Func<TFacadeInterface,Func<TResult>>>methodSelector,Func<TResult>handler)// One parameterpublicBuilderMap<T1,TResult>(Expression<Func<TFacadeInterface,Func<T1,TResult>>>methodSelector,Func<T1,TResult>handler)// Two parameterspublicBuilderMap<T1,T2,TResult>(Expression<Func<TFacadeInterface,Func<T1,T2,TResult>>>methodSelector,Func<T1,T2,TResult>handler)// Up to four parameters supported
sequenceDiagram
participant C as Client
participant F as Facade
participant D as Dictionary
participant O as Operation
C->>F: Execute("process", input)
F->>D: TryGetValue("process")
alt Operation found
D-->>F: index
F->>O: operation(input)
O-->>F: result
F-->>C: result
else Not found, default exists
F->>O: default(input)
O-->>F: result
F-->>C: result
else Not found, no default
F-->>C: throw InvalidOperationException
end
Loading
TypedFacade Dispatch
sequenceDiagram
participant C as Client
participant P as DispatchProxy
participant H as Handler
C->>P: interface.Method(args)
P->>P: Invoke(methodInfo, args)
P->>H: handler.DynamicInvoke(args)
H-->>P: result
P-->>C: result
Loading
Thread Safety
Component
Thread-Safe
Builder
No - single-threaded configuration
Facade<TIn, TOut>
Yes - immutable after build
TypedFacade proxy
Yes - immutable after build
Execute
Yes - but operation logic may not be
Implementation Notes
Operations stored in dictionary + array for O(1) lookup
Dictionary frozen at Build() time
in TIn parameters avoid struct copies
No reflection in string-based facade execution path
TypedFacade uses DispatchProxy (requires .NET Standard 2.1+)