DryIocInversion of control containerCreates new container with default rules .Creates new container, optionally providing to modify default container behavior.
(optional) Rules to modify container default resolution behavior.
If not specified, then will be used.
(optional) Scope context to use for scoped reuse.
Creates new container with configured rules.
Allows to modify rules.
(optional) Scope context to use for .
Helper to create singleton scopePretty prints the container info including the open scope details if any.Dispose either open scope, or container with singletons, if no scope opened.Identifies the service when resolving collectionFactory, the required partOptional keyOptional required service type, can be an open-generic type.Constructs the struct.Directly uses generated factories to resolve service. Or returns the default if service does not have generated factory.Directly uses generated factories to resolve service. Or returns the default if service does not have generated factory.Resolves many generated only services. Ignores runtime registrations.Searches for registered factories by type, and key (if specified),
and by factory type (by default uses ).
May return empty, 1 or multiple factories.Stores factory into container using and as key
for later lookup.
Any subtypes of .
Type of service to resolve later.
(optional) Service key of any type with and
implemented.
(optional) Says how to handle existing registration with the same
and .
Confirms that service and implementation types are statically checked by compiler.
True if factory was added to registry, false otherwise.
False may be in case of setting and already existing factory.
Resolves service with the policy,
enabling the fallback resolution for not registered services (default MS convention).
For diagnostics reasons, you may globally set the rule to alter the behavior.
It may help to highlight the issues by throwing the original rich instead of just returning the `null`.
Setting the factory directly to scope for resolutionThe rules object defines policies per container for registration and resolution.Represents scope bound to container itself, and not the ambient (context) thing.Indicates that container is disposed.Produces new container which prevents any further registrations.
(optional) Controls what to do with the next registration: ignore or throw exception. Throws exception by default.
Converts known item into literal expression or wraps it in a constant expression.The int key is the `FactoryID`
Special service key with info about open-generic service type
Open-generic required service-typeOptional keyConstructs the thingHides/wraps object with disposable interface.Wrapped valueWraps the valueInterpreter of expression - where possible uses knowledge of DryIoc internals to avoid reflectionCalls `TryInterpret` inside try-catch and unwraps/re-throws `ContainerException` from the reflection `TargetInvocationException`Stores parent lambda params and args Parent or the `null` for the root Params A single arg or the array of object args Constructs with parent parent or `null` for the rootInterprets passed expression.Compiles expression to factory delegate.Resolver context parameter expression in FactoryDelegate.The array of a single `ResolverContextParamExpr` for memory optimizationFactoryDelegate.Invoke method info for calling from Reflection
Optimization: the empty lambda with a single IResolverContext parameters
Strips the unnecessary or adds the necessary cast to expression return resultWraps service creation expression (body) into and returns result lambda expression.Wraps service creation expression (body) into and returns result lambda expression.First wraps the input service expression into lambda expression and
then compiles lambda expression to actual used for service resolution.Compiles lambda expression to actual `FactoryDelegate` wrapper.Container extended features.The default key for services registered into container created by Uses the provided or the default to tweak the rules
to use with the `CreateFacade` methodsAllows to register new specially keyed services which will facade the same default service,
registered earlier. May be used to "override" registrations when testing the container.
Facade will clone the source container singleton and open scope (if any) so
that you may safely disposing the facade without disposing the source container scopes.The "child" container detached from the parent container.
With you control how registrations will be shared or separated between the parent and child.
The not `null` will allow mark services registered to child with the specified key,
making them invisible for the parent (if they share the registry). Meanwhile you may resolve them from the child without
specifying any key. So the `childDefaultServiceKey` is like an invisible stamp on the child registration.
The "child" container detached from the parent:
Child creation has O(1) cost - it is cheap thanks to the fast immutable collections cloning.
Child has all parent registrations copied, then the registrations added or removed in the child are not affecting the parent.
By default child will use the parent policy - you may specify `IfAlreadyRegistered.Replace` to "shadow" the parent registrations
Child has an access to the scoped services and singletons already created by parent.
Child can be disposed without affecting the parent, disposing the child will dispose only the scoped services and singletons created in the child and not in the parent (can be opt-out)Shares all of container state except the cache and the new rules.Prepares container for expression generation.Returns new container with all expression, delegate, items cache removed/reset.
But it will preserve resolved services in Singleton/Current scope.Creates new container with state shared with original, except for the singletons and cache.Shares the setup with original container but copies the registrations, so the new registrations
won't be visible in original. Registrations include decorators and wrappers as well.Shares the setup with original container but copies the registrations, so the new registrations
won't be visible in original. Registrations include decorators and wrappers as well.
You may control behavior and opt-in for the keeping or cloning the cache.For given instance resolves and sets properties and fields.
It respects rules set per container,
or if rules are not set it uses .For given instance resolves and sets properties and fields. You may specify what
properties and fields.Creates service using container for injecting parameters without registering anything in if the TYPE is not registered yet.
The note is that container will share the singletons though.Creates service using container for injecting parameters without registering anything in .
Container to use for type creation and injecting its dependencies.
Type to instantiate. Wrappers (Func, Lazy, etc.) is also supported.
(optional) Injection rules to select constructor/factory method, inject parameters,
properties and fields.
The default is Object instantiated by constructor or object returned by factory method.Creates service using container for injecting parameters without registering anything in .Type to instantiate.
Container to use for type creation and injecting its dependencies.
(optional) Injection rules to select constructor/factory method, inject parameters, properties and fields.
The default is Object instantiated by constructor or object returned by factory method.Creates service given strongly-typed creation expression.
Can be used to invoke arbitrary method returning some value with injecting its parameters from container.Method or constructor result type.
Container to use for injecting dependencies.
Creation expression.
The default is Created result.Obsolete: please use WithAutoFallbackDynamicRegistration
Obsolete: please use WithAutoFallbackDynamicRegistration
Provides automatic fallback resolution mechanism for not normally registered
services. Underneath it uses the `WithDynamicRegistrations`.Provides automatic fallback resolution mechanism for not normally registered
services. Underneath it uses the `WithDynamicRegistrations`.Provides automatic fallback resolution mechanism for not normally registered
services. Underneath it uses the `WithDynamicRegistrations`.Provides automatic fallback resolution mechanism for not normally registered
services. Underneath it uses the `WithDynamicRegistrations`.Provides automatic fallback resolution mechanism for not normally registered
services. Underneath it uses the `WithDynamicRegistrations`.Provides automatic fallback resolution mechanism for not normally registered
services. Underneath it uses the `WithDynamicRegistrations`.Provides automatic fallback resolution mechanism for not normally registered
services. Underneath it uses the `WithDynamicRegistrations`.Provides automatic fallback resolution mechanism for not normally registered
services. Underneath it uses the `WithDynamicRegistrations`.Provides automatic fallback resolution mechanism for not normally registered
services. Underneath it uses the `WithDynamicRegistrations`.Creates new container with provided parameters and properties
to pass the custom dependency values for injection. The old parameters and properties are overridden,
but not replaced.
Container to work with.
(optional) Parameters specification, can be used to proved custom values.
(optional) Properties and fields specification, can be used to proved custom values.
New container with adjusted rules.(_ => "Nya!"));
var a = c.Resolve(); // where A accepts string parameter in constructor
Assert.AreEqual("Nya!", a.Message)
]]>Result of GenerateResolutionExpressions methodsResolutions rootsDependency of Resolve callsErrorsGenerates expressions for specified roots and their "Resolve-call" dependencies.
Wraps exceptions into errors. The method does not create any actual services.
You may use Factory .Generates expressions for provided root servicesGenerates expressions for provided root servicesExcluding open-generic registrations, cause you need to provide type arguments to actually create these types.Helps to find potential problems in service registration setup. Method tries to resolve the specified registrations, collects exceptions,
and returns them to user. Does not create any actual service objects. You must specify to define your resolution roots,
otherwise container will try to resolve all registrations, which usually is not realistic case to validate.Same as the Validate with the same parameters but throws the exception with all collected errorsHelps to find potential problems when resolving the .
Method will collect the exceptions when resolving or injecting the specific root. Does not create any actual service objects.
You must specify to define your resolution roots, otherwise container will try to resolve all registrations,
which usually is not realistic case to validate.Same as the Validate with the same parameters but throws the exception with all collected errorsRe-constructs the whole request chain as request creation expression.Same as the Validate with the same parameters but throws the exception with all collected errorsClears delegate and expression cache for specified .
But does not clear instances of already resolved/created singletons and scoped services!Helps to find potential problems in service registration setup by trying to resolve the and
returning the found errors. This method does not throw.Clears delegate and expression cache for specified service.
But does not clear instances of already resolved/created singletons and scoped services!Setting the factory directly to scope for resolutionInterface used to convert reuse instance to expression.Returns expression representation without closure.
Use to converting the sub-items, constants to container.Used to represent multiple default service keys.
Exposes to determine order of service added.Default value.Allows to determine service registration order.Returns the default key with specified registration order.Converts to expressionReturns next default key with increased .Compares keys based on registration order. The null (represents default) key is considered equal.Returns registration order as hash.Prints registration order to string.Represents default key for dynamic registrationsDefault value.Associated ID.Returns dynamic key with specified ID.Converts to expressionReturns next dynamic key with increased .Compares key's IDs. The null (default) key is considered equal!Returns key index as hash.Prints registration order to string.Extends IResolver to provide an access to scope hierarchy.True if container is disposed.Usually the disposal stack trace (if supported) to add the error message
to identify the place and possible reason of disposal. The `null` otherwiseParent context of the scoped context.The root context of the scoped context.Singleton scope, always associated with root scope.Optional ambient scope context.Current opened scope. May return the current scope from if context is not null.This property exist mostly for the performance reasons to have single virtual call instead of
`CurrentScope ?? SingletonScope`The current scope belonged to the resolver context and not to the scope context. Maybe null if ScopeContext is not null.Creates the resolver context with specified current Container-OWN scopePuts instance created via the passed factory on demand into the current or singleton scopeFor given instance resolves and sets properties and fields.Provides a usable abstractions for Just a sugar that allow to get root or self container.Finds the correct resolver context expression for e.g. resolution calls dependency,
or for the injecting the resolver context as parameter, opening the resolution scope, etc.Root or the current resolver context (if it is the root).Resolver parameter expression.Access to the current scope.Access to the current scope or singletons.Indicates that context is scoped - that's is only possible if container is not the Root one and has a Parent contextGet current scope or throw the exception otherwise.Get current scope expression or throw the exception otherwise.Provides access to the current scope - may return `null` if ambient scope context has it scope changed in-betweenGets current scope matching the Opens scope with optional name and optional tracking of new scope in a parent scope.
Parent context to use.
(optional)
(optional) Instructs to additionally store the opened scope in parent,
so it will be disposed when parent is disposed. If no parent scope is available the scope will be tracked by Singleton scope.
Used to dispose a resolution scope.
Scoped resolver context.();
handler.Handle(data);
}
]]>Opens scope with optional name and optional tracking of new scope in a parent scope.();
handler.Handle(data);
}
]]>Check if the service instance or factory is added to the current or singleton scopeCheck if the service instance or factory is added to the current or singleton scopeA bit if sugar to track disposable in the current scope or in the singleton scope as a fallbackThe result delegate generated by DryIoc for service creation.The stronly typed delegate for service creation registered as a Wrapper.Adds to Container support for:
Open-generic servicesService generics wrappers and arrays using extension point.
Supported wrappers include: Func of , Lazy, Many, IEnumerable, arrays, Meta, KeyValuePair, DebugExpression.
All wrapper factories are added into collection of .
unregistered resolution rule.Supported Func types.Supported Action types. Yeah, action I can resolve or inject void returning method as action.Supported open-generic collection types - all the interfaces implemented by array.Returns true if type is supported , and false otherwise.Registered wrappers by their concrete or generic definition service type.Gets the expression for wrapper.
The resolution request.
The already resolved factory by the collection or the higher wrapper.
Expression: new Lazy(() => r.Resolve{TService}(key, ifUnresolved, requiredType))]]>Exposing for creation of custom delegates #243Discovers and combines service with its setup metadata.
Works with any generic type with first Type arg - Service type and second Type arg - Metadata type,
and constructor with Service and Metadata arguments respectively.
- if service key is not specified in request then method will search for all
registered factories with the same metadata type ignoring keys.
- if metadata is IDictionary{string, object},
then the First value matching the TMetadata type will be returned.Find out if factory metadata is matches the passed metadata typeRepresents info required for dynamic registration: service key, factory,
and option how to combine dynamic with normal registrations.FactoryOptional: will be by default.Optional service key: if null the default will be used. Constructs the registrationThe options for the single dynamic registration provider.
The dynamic Wrapper registration is not supported.No flags - to use in `HasDynamicRegistrationProvider`Use as AsFallback onlyProvider may have the services providedProvider may have the decorators providedSpecifies that provider should be asked for the `object` service type to get the decorator for the generic `T` service Defines resolution/registration rules associated with Container instance. They may be different for different containers.Default rules as a staring point.Checks if the rules include the same settings and conventions as .
It also means that the rules may include the additional things like `WithConcreteTypeDynamicRegistrations`, etc.The rules implementing the conventions of Microsoft.Extension.DependencyInjection library.Returns the copy of the rules with the applied conventions of Microsoft.Extension.DependencyInjection library.
Before calling this method to avoid the copying you may consider to check if the rules are already .
By default the `IServiceProvider.GetService` is returning `null` if service is not resolved.
So you need to call the `GetRequiredService` extension method which in turn requires the implementation of `ISupportRequiredService` underneath.
To help with this mess you may use this rule to force the `GetService` to throw an exception the same as calling `GetRequiredService`.
This may help to diagnose the problems in debug or in tests, or in some custom setup.The default total dependency count - a expression tree node count to split the object graphThe total dependency count - the expression tree node count to split the object graph.
That does not mean the graph can be always split at this number, consider the example graph and
the dependency count threshold set to 3:
`x = new X(new Y(A, new B(K), new C(new L(), new M())), new Z())`
The tree is resolved from the left to the right in the depth-first order:
A; then K, B (at this point Y is already has 3 dependencies but is not fully resolved until C is resolved);
then L, M, C (here Y is fully resolved with 6 dependencies) so we can split it only on 6 dependencies instead of 3.
The split itseft just wraps the node in `Func{T}` delegate making it a separate compilation unit.
In our example it will be `Func{Y} f = () => new Y(A, new B(K), new C(new L(), new M()))` considering
that everything is transient.
Sets the Disables the limitation.Shorthand to Shorthand to Shorthand to Instructs to override per-registration made settings with these rules settings.Returns the parameter selector based on Returns the properties and fields selectorbased on Returns new instance of the rules new Made composed out of
provided factory method, parameters, propertiesAndFields.Returns new instance of the rules with specified .
New Made.Of rules.
Instructs to override registration level Made.Of
New rules.Service key to be used instead on `null` in registration.Sets the Defines single factory selector delegate.
The only one of the passed parameters `singleDefaultFactory` or `orManyDefaultAndKeyedFactories` is not `null`Single selected factory or null if unable to select.Rules to select single matched factory default and keyed registered factory/factories.
Selectors applied in specified array order, until first returns not null .
Default behavior is to throw on multiple registered default factories, cause it is not obvious what to use.Sets Select last registered factory from the multiple default.A commonly used rule, the flag is for optimizationTries to select a single factory based on the minimal reuse life-span ignoring the TransientsTries either SelectFactoryWithTheMinReuseLifespan or SelectLastRegisteredFactoryPrefer specified service key (if found) over default key.
Help to override default registrations in Open Scope scenarios:
I may register service with key and resolve it as default in current scope.Specify the method signature for returning multiple keyed factories.
This is dynamic analog to the normal Container Registry.
Requested service type.
(optional) If null will request all factories of Key-Factory pairs.Providers for resolving multiple not-registered services. Null by default.Get the specific providers with the specified flags and without the flags or return `null` if nothing foundReturns the new rules with the passed dynamic registration rule appended.The flags per dynamic registration providerReturns the new rules with the passed dynamic registration rules appended.Only services and no decorators as it will greately affect the performance,
calling the provider for every resolved serviceReturns the new rules with the passed dynamic registration rules appended.
The rules applied only when no normal registrations found!Returns the new rules with the passed dynamic registration rules appended.
The rules applied only when no normal registrations found!Returns the new rules with the passed dynamic registration rules appended.
The rules applied only when no normal registrations found!Obsolete: Instead use `HasDynamicRegistrationProvider(DynamicRegistrationFlags.AsFallback)`Defines delegate to return factory for request not resolved by registered factories or prior rules.
Applied in specified array order until return not null .Gets rules for resolving not-registered services. Null by default.Appends resolver to current unknown service resolvers.Removes specified resolver from unknown service resolvers, and returns new Rules.
If no resolver was found then will stay the same instance,
so it could be check for remove success or fail.Sugar on top of to simplify setting the diagnostic action.
Does not guard you from action throwing an exception. Actually can be used to throw your custom exception
instead of .The alternative is ConcreteTypeDynamicRegistrationsRule to automatically resolves non-registered service type which is: nor interface, nor abstract, nor registered wrapper type.
For constructor selection we are using automatic constructor selection.
(optional) Condition for requested service type and key.
(optional) Reuse for concrete types.
New rule.Rule to automatically resolves non-registered service type which is: nor interface, nor abstract, nor registered wrapper type.
For constructor selection we are using automatic constructor selection.
Pass `IfUnresolved.ReturnDefault` or `IfUnresolved.ReturnDefaultIfNotRegistered` to `ifConcreteTypeIsUnresolved`
to allow fallback to the next rule.Automatically resolves non-registered service type which is: nor interface, nor abstract.Automatically resolves non-registered service type which is: nor interface, nor abstract.
Pass `IfUnresolved.ReturnDefault` or `IfUnresolved.ReturnDefaultIfNotRegistered` to `ifConcreteTypeIsUnresolved`
to allow fallback to the next rule.
[Obsolete("Replaced with `WithConcreteTypeDynamicRegistrations`")]
Creates dynamic fallback registrations for the requested service type
with provided .
Fallback means that the dynamic registrations will be applied Only if no normal registrations
exist for the requested service type, hence the "fallback".
Implementation types to select for service.
(optional) Handler to customize the factory, e.g.
specify reuse or setup. Handler should not return null.
Registration provider.Obsolete: replaced by See The reuse used in case if reuse is unspecified (null) in Register methods.Given item object and its type should return item "pure" expression presentation,
without side-effects or external dependencies.
e.g. for string "blah" Expression.Constant("blah", typeof(string)).
If unable to convert should return null..Specifies custom rule to convert non-primitive items to their expression representation.
That may be required because DryIoc by default does not support non-primitive service keys and registration metadata.
To enable non-primitive values support DryIoc need a way to recreate them as expression tree..Turns off throwing exception when dependency has shorter reuse lifespan than its parent or ancestor.New rules with new setting value..Turns On throwing the exception when Singleton or Scope service has a Transient dependencyTurns Off throwing the exception when Singleton or Scope service has a Transient dependency (the default)Turns Off the rule .
Allows to register disposable transient but it is up to you to handle their disposal.
You can use to actually track disposable transient in
container, so that disposal will be handled by container.
Turns on the storing of disposable transients in the current scope or in the singleton scope if no scopes are opened.
It is required to be able to Dispose the Transient at specific time when the scope is disposed or where container
with singletons is disposed.
The storing disposable transients in the singleton scope means that they won't be disposed until
the whole container is disposed. That may pose a problem similar to the "memory leak" because more and more transients
will be created and stored never disposed until whole container is disposed. Therefore you
need to think if you really need the disposable to be the Transient. Whatever, just be aware of it.
.
The opposite of removing the tracking,
which maybe helpful e.g. for undoing the rule from the Microsoft.DependencyInjection conforming rules.
Turns off optimization: creating singletons during resolution of object graph..Indicates that container is used for generation purposes, so it should use less runtime stateSpecifies to generate ResolutionCall dependency creation expression and stores the result
in the-per rules collection.Removes runtime optimizations preventing an expression generation.Indicates that rules are used for the validation, e.g. the rules created in `Validate` methodSpecifies to generate ResolutionCall dependency creation expression and stores the result
in the-per rules collection.Removes implicit Factory for non-transient service.
The Condition filters out factory without matching scope..Specifies to resolve IEnumerable as LazyEnumerable..Flag instructs to include covariant compatible types into the resolved collection.Flag instructs to exclude covariant compatible types into the resolved collection..Flag instructs to include covariant compatible types into the resolved generic.Flag instructs to exclude covariant compatible types into the resolved generic..Specifies default setting for container. By default is .
Example of use: specify Keep as a container default, then set AppendNonKeyed for explicit collection registrations..The thing.Specifies to throw an exception in attempt to resolve service which require runtime state for resolution.
Runtime state may be introduced by RegisterDelegate, RegisterInstance, or registering with non-primitive service key, or metadata..Instructs to capture Dispose stack-trace to include it later into
exception for easy diagnostics.Allows Func with args specify its own reuse (sharing) behavior.Allows Func with args specify its own reuse (sharing) behavior.Allows Func of service to be resolved even without registered service.Allows Func of service to be resolved even without registered service.Removes the rule `FuncAndLazyWithoutRegistration`.
Subject-subject
Fallbacks to system `Expression.Compile()`
Subject
Uses DryIoc own interpretation mechanism or is falling back to `Compile(preferInterpretation: true)`Uses DryIoc own interpretation mechanism or is falling back to `Compile(preferInterpretation: true)`If Decorator reuse is not set instructs to use `Decorator.SetupWith(useDecarateeReuse: true)`If Decorator reuse is not set instructs to use `Decorator.SetupWith(useDecarateeReuse: true)`
Outputs most notable non-default rules
Wraps constructor or factory method optionally with factory instance to create service.Constructor or method to use for service creation.Identifies factory service if factory method is instance member.
Alternatively you may just provide an expression for factory
Contains resolved parameter expressions found when looking for most resolvable constructorJust creates a thingy from the constructorWraps method and factory instance.
Where is constructor, static or instance method, property or field.Wraps method and factory instance.
Where is constructor, static or instance method, property or field.Discovers the static factory method or member by name in .
Should play nice with C# operator.Pretty prints wrapped method.Easy way to specify non-public and most resolvable constructor.
(optional) Instructs to select constructor with max number of params which all are resolvable.
(optional) Consider the non-public constructors.
Constructor or null if not found.Easy way to specify default constructor to be used for resolution.Searches for a single constructor excluding the ones with the same implementation type as parameter.
Used by the AutoConcrete type resolution to avoid selection of recursive constructors like `Foo(Foo f)`Better be named `ConstructorWithMostResolvableArguments`.
Searches for public constructor with most resolvable parameters or throws if not found.
Works both for resolving service and `Func{TArgs..., TService}`Searches for constructor (including non public ones) with most resolvable parameters or throws if not found.
Works both for resolving service and for Func{TArgs..., TService}Rules how to: Select constructor for creating service with .Specify how to resolve constructor parameters with .Specify what properties/fields to resolve and how with .The factory method or its selector based on the request.Return type of strongly-typed factory method expression.Specifies how constructor parameters should be resolved:
parameter service key and type, throw or return default value if parameter is unresolved.Specifies what should be used when resolving property or field.
Has any conditional flags
True if made has properties or parameters with custom value.
That's mean the whole made become context based which affects caching.Indicates that the implementation type depends on request.
Indicates that the member depends on request
Outputs whatever is possible (known) for MadeContainer will use some sensible defaults for service creation.Creates rules with only specified.Creates rules with only specified.Creates rules with only specified.Specifies injections rules for Constructor, Parameters, Properties and Fields. If no rules specified returns rules.Specifies injections rules for Constructor, Parameters, Properties and Fields. If no rules specified returns rules.Creates factory method specificationCreates factory specification with implementation type, conditionally depending on request.Creates factory specification with method or member selector based on request.
Where is method, or constructor, or member selector.Creates factory specification with method or member selector based on request.
Where Method, or constructor, or member selector.Defines how to select constructor from implementation type.
Where is delegate taking implementation type as input
and returning selected constructor info.Defines factory method using expression of constructor call (with properties), or static method call.Type with constructor or static method.
Expression tree with call to constructor with properties:
new Car(Arg.Of()) { Color = Arg.Of("CarColor") }]]>
or static method call Car.Create(Arg.Of())]]>
(optional) Primitive custom values for dependencies.
New Made specification.Defines creation info from factory method call Expression without using strings.
You can supply any/default arguments to factory method, they won't be used, it is only to find the .Factory type.Factory product type.
Returns or resolves factory instance.
Method, property or field expression returning service.
(optional) Primitive custom values for dependencies.
New Made specification.Composes Made.Of expression with known factory instance and expression to get a serviceTyped version of specified with statically typed expression tree.Class for defining parameters/properties/fields service info in expressions.
Arg methods are NOT actually called, they just used to reflect service info from call expression.Specifies required service type of parameter or member. If required type is the same as parameter/member type,
the method is just a placeholder to help detect constructor or factory method, and does not have additional meaning.Specifies both service and required service types.Specifies required service type of parameter or member. Plus specifies if-unresolved policy.Specifies both service and required service types.Specifies required service type of parameter or member. Plus specifies service key.Specifies both service and required service types.Specifies required service type of parameter or member. Plus specifies service key.Specifies both service and required service types.Specifies required service type of parameter or member. Plus specifies if-unresolved policy. Plus specifies service key.Specifies both service and required service types.Specifies required service type, default value and .Specifies required service type, default value and .Specifies argument index starting from 0 to use corresponding custom value factory,
similar to String.Format "{0}, {1}, etc".Name is close to method itself to not forget when renaming the method.Contains extension methods to simplify general use cases.The base method for registering service with its implementation factory. Allows to specify all possible options.Registers service with corresponding .Registers service with corresponding .Registers service of .
ServiceType may be the same as .Registers service of type
implemented by type.Registers implementation type with itself as service type.Registers service type returned by Made expression.Registers service returned by Made expression.
Registers the instance creating a "normal" DryIoc registration so you can check it via `IsRegistered`,
apply wrappers and decorators, etc.
Additionally, if instance is `IDisposable`, then it tracks it in a singleton scope.
Look at the `Use` method to put instance directly into current or singleton scope,
though without ability to use decorators and wrappers on it.
Tracks the disposable instance in the singleton scopeTracks the disposable instance in the singleton scope
Registers the instance creating a "normal" DryIoc registration so you can check it via `IsRegestered`,
apply wrappers and decorators, etc.
Additionally, if instance is `IDisposable`, then it tracks it in a singleton scope.
Look at the `Use` method to put instance directly into current or singleton scope,
though without ability to use decorators and wrappers on it.
Registers the instance creating a "normal" DryIoc registration so you can check it via `IsRegistered`,
apply wrappers and decorators, etc.
Additionally, if instance is `IDisposable`, then it tracks it in a singleton scope.
Look at the `Use` method to put instance directly into current or singleton scope,
though without ability to use decorators and wrappers on it.
Registers the instance with possible multiple service types creating a "normal" DryIoc registration
so you can check it via `IsRegistered` for each service type,
apply wrappers and decorators, etc.
Additionally, if instance is `IDisposable`, then it tracks it in a singleton scope.
Look at the `Use` method to put instance directly into current or singleton scope,
though without ability to use decorators and wrappers on it.
Registers the instance with possible multiple service types creating a "normal" DryIoc registration
so you can check it via `IsRegestered` for each service type,
apply wrappers and decorators, etc.
Additionally, if instance is `IDisposable`, then it tracks it in a singleton scope.
Look at the `Use` method to put instance directly into current or singleton scope,
though without ability to use decorators and wrappers on it.
Registers the instance with possible multiple service types creating a "normal" DryIoc registration
so you can check it via `IsRegestered` for each service type,
apply wrappers and decorators, etc.
Additionally, if instance is `IDisposable`, then it tracks it in a singleton scope.
Look at the `Use` method to put instance directly into current or singleton scope,
though without ability to use decorators and wrappers on it.
Checks some common .NET types to exclude.Checks that type can be used a service type.Checks if type can be used as implementation type for reflection factory,
and therefore registered to container. Usually used to discover implementation types from assembly.Returns only those types that could be used as service types of .
It means that for open-generic its service type should supply all type arguments.The same `GetImplementedServiceTypes` but instead of collecting the service types just check the is implementedReturns the sensible services automatically discovered for RegisterMany implementation type.
Excludes the collection wrapper interfaces. The may be concrete, abstract or
generic definition.Returns the types suitable to be an implementation types for :
actually a non abstract and not compiler generated classes.Returns the types suitable to be an implementation types for :
actually a non abstract and not compiler generated classes.Sugar, so you can say (Registrator.Interfaces)]]>Checks if implements a service type,
along the checking if is a valid implementation type.Checks if implements a service type,
along the checking if and service type
are valid implementation and service types.Wraps the implementation type in factory.Wraps the implementation type in factory plus allow to provide factory parameters.
Batch registering the implementations with possibly many service types,
throwing the error when there are no services types to register.
You may pass the predefined to .
By default uses the with the default reuse,
or you may return the with the of your choice.
Batch registering the implementations with possibly many service types,
ignoring the case when there are no services types to register.
You may pass the predefined to .
By default uses the with the default reuse,
or you may return the with the of your choice.
Batch registers implementation with possibly many service types.Batch registers assemblies of implementation types with possibly many service types.
The default factory is the with default reuse.Registers many implementations with their auto-figured service types.Registers many implementations with auto-figured service types.Registers single registration for all implemented public interfaces and base classes.Registers single registration for all implemented public interfaces and base classes.
Minimizes the number of allocations when converting from Func to named delegate
Lifts the result to the factory delegate without allocations on capturing value in lambda closure
Registers a factory delegate for creating an instance of .
Delegate can use resolver context parameter to resolve any required dependencies, e.g.:
(r => new Car(r.Resolve()))]]>The alternative to this method please consider using instead:
(Made.Of(() => new Car(Arg.Of())))]]>.
Registers delegate to be injected by container avoiding the ServiceLocator anti-patternRegisters delegate with explicit arguments to be injected by container avoiding the ServiceLocator anti-patternRegisters delegate with the explicit arguments to be injected by container avoiding and with object return type known at runtimeRegisters delegate with the explicit arguments to be injected by container.
The delegate accepts the object parameters with the runtime known typesRegisters delegate with explicit arguments to be injected by container avoiding the ServiceLocator anti-patternRegisters delegate with the explicit arguments to be injected by container avoiding and with object return type known at runtimeRegisters delegate with the explicit arguments to be injected by container.
The delegate accepts the object parameters with the runtime known typesRegisters delegate with explicit arguments to be injected by container avoiding the ServiceLocator anti-patternRegisters delegate with the explicit arguments to be injected by container avoiding and with object return type known at runtimeRegisters delegate with the explicit arguments to be injected by container.
The delegate accepts the object parameters with the runtime known typesRegisters delegate with explicit arguments to be injected by container avoiding the ServiceLocator anti-patternRegisters delegate with the explicit arguments to be injected by container avoiding and with object return type known at runtimeRegisters delegate with the explicit arguments to be injected by container.
The delegate accepts the object parameters with the runtime known typesRegisters delegate with explicit arguments to be injected by container avoiding the ServiceLocator anti-patternRegisters delegate with the explicit arguments to be injected by container avoiding and with object return type known at runtimeRegisters delegate with the explicit arguments to be injected by container.
The delegate accepts the object parameters with the runtime known typesRegisters delegate with explicit arguments to be injected by container avoiding the ServiceLocator anti-patternRegisters delegate with the explicit arguments to be injected by container avoiding and with object return type known at runtimeRegisters delegate with the explicit arguments to be injected by container.
The delegate accepts the object parameters with the runtime known typesRegisters delegate with explicit arguments to be injected by container avoiding the ServiceLocator anti-patternRegisters delegate with the explicit arguments to be injected by container avoiding and with object return type known at runtimeRegisters delegate with the explicit arguments to be injected by container.
The delegate accepts the object parameters with the runtime known typesRegisters a factory delegate for creating an instance of .
Delegate can use resolver context parameter to resolve any required dependencies, e.g.:
(r => new Car(r.Resolve()))]]>IMPORTANT: The method should be used as the last resort only! Though powerful it is a black-box for container,
which prevents diagnostics, plus it is easy to get memory leaks (due variables captured in delegate closure),
and impossible to use in compile-time scenarios.
Consider using instead:
(Made.Of(() => new Car(Arg.Of())))]]>Obsolete("Replaced with RegisterDelegate{MyService, Dep1...Dep2, MyService}((service, d1, d2) => new MyServiceDecorator(service, d1, d2), setup: Setup.DecoratorWith(useDecorateeReuse: true, condition: optional))")Adding the factory directly to scope for resolutionAdding the factory directly to the scope for resolutionAdding the factory directly to the scope for resolutionAdding the instance directly to the scope for resolutionAdding the instance directly to the scope for resolutionAdding the factory directly to the scope for resolutionAdding the factory directly to the scope for resolutionAdding the factory directly to the scope for resolutionAdding the instance directly to scope for resolutionAdding the instance directly to scope for resolutionAdding the factory directly to scope for resolutionAdding the factory directly to scope for resolutionAdding the factory directly to scope for resolutionAdding the instance directly to scope for resolutionAdding the instance directly to scope for resolution
Registers initializing action that will be called after service is resolved
just before returning it to the caller. You can register multiple initializers for a single service.
Or you can register initializer for the type to be applied
for all services and use to specify the target services.
Note: The initializer action has the same reuse as a initialized (decorated) service.
Registers initializing action that will be called after service is resolved
just before returning it to the caller. You can register multiple initializers for a single service.
Or you can register initializer for the type to be applied
for all services and use to specify the target services.
Note: You may specify a different from the initiliazed object enabling the
action to run once (Singleton), run once-per-scope (Scoped), run always (Transient).
Note2: By convention the initializer is not applied for wrappers (collections, Func, Lazy, etc.). If you need this you may directly use the decorator.
Registers dispose action for reused target service.Returns true if is registered in container OR
its open generic definition is registered in container.
The additional implementation factory may be specified to narrow the search.Returns true if is registered in container OR
its open generic definition is registered in container.
The additional implementation factory may be specified to narrow the search.Removes specified registration from container.
It also tries to remove the cached resolutions for the removed registration, But it may not work depending on context.
Check the docs for more info: https://github.com/dadhi/DryIoc/blob/master/docs/DryIoc.Docs/UnregisterAndResolutionCache.md Removes specified registration from container.
It also tries to remove the cached resolutions for the removed registration, But it may not work depending on context.
Check the docs for more info: https://github.com/dadhi/DryIoc/blob/master/docs/DryIoc.Docs/UnregisterAndResolutionCache.md Registers new service type with factory for registered service type.
Throw if no such registered service type in container.
Registrator New service type.
Existing registered service type.
The registration to overwrite or preserve the already registered service
(optional) (optional)
(optional) By default is Registers new service type with factory for registered service type.
Throw if no such registered service type in container.Registers new service type with factory for registered service type.
Throw if no such registered service type in container.
Registrator
New service type.Existing registered service type.
(optional) (optional)
(optional) By default is Register a service without implementation which can be provided later in terms
of normal registration with `IfAlreadyRegistered.Replace` parameter.
When the implementation is still not provided when the placeholder service is accessed, then the exception will be thrown.
This feature allows you to postpone the decision on implementation until it is later known.Internally the empty factory is registered with the setup `asResolutionCall: true`.
That means, instead of placing service instance into graph expression we put here redirecting call to
container Resolve.Register a service without implementation which can be provided later in terms
of normal registration with `IfAlreadyRegistered.Replace` parameter.
When the implementation is still not provided when the placeholder service is accessed,then the exception will be thrown.
This feature allows you to postpone decision on implementation until it is later known.Internally the empty factory is registered with the setup `asResolutionCall: true`.
That means, instead of placing service instance into graph expression we put here redirecting call to
container Resolve.Registers new service type with factory for registered service type.
Throw if no such registered service type in container.
Container
New service type.Existing registered service type.
The registration to overwrite or preserve the already registered service
(optional) (optional)
Extension methods for .Resolves instance of service type from container. Throws exception if unable to resolve.Resolves instance of service type from container.Resolves instance of type TService from container.Tries to resolve instance of service type from container.Tries to resolve instance of TService from container.Returns instance of searching for .
In case of being generic wrapper like Func, Lazy, IEnumerable, etc.
allow you to specify wrapped service type.();
var services = container.Resolve(typeof(IEnumerableReturns instance of searching for .
In case of being generic wrapper like Func, Lazy, IEnumerable, etc.
allow you to specify wrapped service type.();
var services = container.Resolve>(typeof(IService));
]]>Returns instance of searching for .
In case of being generic wrapper like Func, Lazy, IEnumerable, etc.
allow you to specify wrapped service type.();
var services = container.Resolve, IService>();
]]>Returns instance of searching for .
In case of being generic wrapper like Func, Lazy, IEnumerable, etc.,
could specify wrapped service type.Using implicitly support Covariance for generic wrappers even in .Net 3.5.();
var services = container.Resolve(typeof(LazyReturns instance of type.The type of the requested service.The requested service instance.Using implicitly support Covariance for generic wrappers even in .Net 3.5.Resolves the service supplying all or some of its dependencies
(including nested) with the . The rest of dependencies is injected from
container.Resolves the service supplying all or some of its dependencies
(including nested) with the . The rest of dependencies is injected from
container.Returns all registered services instances including all keyed and default registrations.
Use to return either all registered services at the moment of resolve (dynamic fresh view) or
the same services that were returned with first call (fixed view).Return collection item type.
It denotes registered service type if is not specified.The same result could be achieved by directly calling:
>(); // for dynamic result - default behavior
container.Resolve(); // for fixed array
container.Resolve>(); // same as fixed array
]]>Returns all registered services as objects, including all keyed and default registrations.Creates a service by injecting its parameters registered in the container but without registering the service itself in the container.Creates a service by injecting its parameters registered in the container but without registering the service itself in the container.Creates a service by injecting its parameters registered in the container but without registering the service itself in the container.Used for internal purposes to create the expression of Resolve method of the passed `request`Specifies result of : either dynamic(lazy) or fixed view.Lazy/dynamic item resolve.Fixed array of item at time of resolve, newly registered/removed services won't be listed.Controls the registry changeChange is permitted - the default settingThrows the error for the new registrationIgnores the next registrationProvides optional service resolution details: service key, required service type, what return when service is unresolved,
default value if service is unresolved, custom service value.
Default details if not specified, use default setting values, e.g.
Default details with option.
Default details with option.
Creates new details out of provided settings, or returns default if all settings have default value.Creates new details out of provided settings, or returns default if all settings have default value.Sets custom value for service. This setting is orthogonal to the rest.
Using default value with invalid ifUnresolved.Throw option to indicate custom value.Service type to search in registry. Should be assignable to user requested service type.Service key provided with registration.Metadata key to find in metadata dictionary in resolved service.Metadata value to find in resolved service.Indicates that the custom value is specified.Either default or custom value depending on setting.Policy to deal with unresolved request.Value to use in case is set to not Throw.Custom value specified for dependency. The IfUnresolved.Throw is the marker of custom value comparing to default value.Pretty prints service details to string for debugging and errors.Details string.Check all property for the equalityContains tools for combining or propagating of independent of its concrete implementations.Creates service info with new type but keeping the details.Creates new info with new IfUnresolved behavior or returns the original info if behavior is not different,
or the passed info is not a .Combines service info with details. The main goal is to combine service and required service type.Enables propagation/inheritance of info between dependency and its owner:
for instance for wrappers.Enables propagation/inheritance of info between dependency and its owner:
for instance for wrappers.Enables propagation/inheritance of info between dependency and its owner:
for instance for wrappers.Returns required service type if it is specified and assignable to service type,
otherwise returns service type.Appends info string representation into provided builder.Represents custom or resolution root service info, there is separate representation for parameter,
property and field dependencies.Creates info out of provided settingsType of service, identifies the registered service in registry.Additional settings. If not specified uses .Service key provided with registration.Creates info from service type and details.Creates info out of provided settingsCreates info out of provided settingsCreates info out of the provided settingsCreates info out of provided settingsCreates info out of provided settingsCreates info out of provided settingsTyped service infoCreates the service infoCreates service info using typed .Strongly-typed version of Service Info.Service type.Prints info to string using .Printed string.Provides for parameter, by default using parameter type as .For parameter default setting is .Parameter info.Creates service info from parameter alone, setting service type to parameter type,
and setting resolution policy to if parameter is optional.Creates service info from the parameter, type and the detailsCreates info from service type and details.Prints info to string using .Printed string.Creates info from service type and details.Base class for property and field dependency info.Creates the service infoOptional details: service key, if-unresolved policy, required service type.Either or .Sets property or field value on provided holder object.
Holder of property or field. Value to set.
Create property or field service info out of provided member.Create property service info out of provided property.Create property service info out of provided property with the details of `IfUnresolved.Throw`.Create field service info out of provided property.Stored check results of two kinds: inherited down dependency chain and not.Nothing is setNot inheritedInheritedInheritedIndicates that the request is the one from Resolve call.Non inheritedNon inheritedNon inherited. Marks the expression to be added to generated resolutions to prevent infinite recursionNon inherited. Indicates the root service inside the function.Helper extension methods to use on the bunch of factories instead of lambdas to minimize allocationsMatching factory condition if any and the metadata if anyMatching thingsMatching thingsMatching thingsTracks the requested service and resolved factory details in a chain of nested dependencies.Empty terminal request.Empty request which opens resolution scope.Creates the Resolve request. The container initiated the Resolve is stored within request.Creates the Resolve request. The container initiated the Resolve is stored within request.Creates the Resolve request. The container initiated the Resolve is stored within request.Available at runtime only, provides an access to container initiated the request.Request immediate parent.Input arguments provided with `Resolve`Service reuse.Constructor selected by the reflection factoryResolved factory ID, used to identify applied decorator.ID of decorated factory in case of decorator factory typeType of factory: Service, Wrapper, or Decorator.Persisted request conditionsNumber of nested dependencies. Set with each new Push.The total dependency countCombines decorator and Runtime known resolve factory, otherwise is nullService implementation type if known.Sets the service factory already resolved by the wrapper to save for the future factory resolutionIndicates that request is empty initial request.Returns true if request is First in First Resolve call.Returns true if request is First in Resolve call.Not the root resolution call.Despite its name, returns true if request is first dependency in a service opening the scopeChecks if the request Or its parent is wrapped in Func. Use `IsDirectlyWrappedInFunc` for the direct Func wrapper.Checks if the request is directly wrapped in FuncChecks if request has parent with service type of Func with arguments.Returns expression for func arguments.Indicates that requested service is transient disposable that should be tracked.Indicates the request is singleton or has singleton upper in dependency chain.Current scopeSingletonsShortcut to issued container rules.(optional) Made spec used for resolving request.Returns service parent skipping wrapper if any. To get direct parent use .Requested service type.Compatible required or service type.Get the detailsOptional service key to identify service of the same type.Policy to deal with unresolved service.Required service type if specified.Relative number representing reuse lifespan.Known implementation, or otherwise actual service type.Creates new request with provided info, and links current request as a parent.
Allows to set some additional flags. Existing/parent request should be resolved to
factory via `WithResolvedFactory` before pushing info into it.Creates new request with provided info, and links current request as a parent.
Allows to set some additional flags. Existing/parent request should be resolved to
factory via `WithResolvedFactory` before pushing info into it.Creates new request with provided info, and links current request as a parent.
Allows to set some additional flags. Existing/parent request should be resolved to
factory via `WithResolvedFactory` before pushing info into it.Composes service description into and Pushes the new request.Creates info by supplying the properties and chaining it with current (parent) info.Creates info by supplying the properties and chaining it with current (parent) info.Creates info by supplying the properties and chaining it with current (parent) info.Creates info by supplying the properties and chaining it with current (parent) info.Creates info by supplying all the properties and chaining it with current (parent) info.Allow to switch current service info to the new one, e.g. in decorators
Produces the new request with the changed `ifUnresolved` or returns original request otherwise
Updates the flagsSets service key to passed value. Required for multiple default services to change null key to
actual Prepends input arguments to existing arguments in request. It is done because the
nested Func/Action input argument has a priority over outer argument.
The arguments are provided by Func and Action wrappers, or by `args` parameter in Resolve call.Returns new request with set implementation details.
Factory to which request is resolved.
(optional) does not check for recursive dependency.
Use with caution. Make sense for Resolution expression.
(optional) allows to skip reuse mismatch aka captive dependency check.
Make a defensive copy of request.
New request with set factory.Check for the parents.Check for the parents until very end.If request corresponds to dependency injected into parameter,
then method calls handling and returns its result.
If request corresponds to property or field, then method calls respective handler.
If request does not correspond to dependency, then calls handler.Enumerates self and all request stack parents.Prints current request info only (no parents printed) to provided builder.Prints full stack of requests starting from current one using .Prints whole request chain.Returns true if request info and passed object are equal, and their parents recursively are equal.Returns true if request info and passed info are equal, and their parents recursively are equal.Compares self properties but not the parents.Calculates the combined hash code based on factory IDs.
Severe the connection with the request pool up to the parent so that no one can change the Request state
Type of services supported by Container.(default) Defines normal service factoryDefines decorator factoryDefines wrapper factory.Base class to store optional settings.Factory type is required to be specified by concrete setups as in
, , .Predicate to check if factory could be used for resolved request.Relative disposal order when defined. Greater number, later dispose.Arbitrary metadata object associated with Factory/Implementation, may be a dictionary of key-values.Returns true if passed meta key and value match the setup metadata.Retrieve the whole metadata object matched to the type or value from the metadata dictionary matched by the typeIndicates that injected expression should be:
(...)]]>
instead of: Setup with the only setting of `AsResolutionCall`
Works as `AsResolutionCall` but only with `Rules.UsedForExpressionGeneration`Specifies to use `asResolutionCall` but only in expression generation context, e.g. for compile-time generationMarks service (not a wrapper or decorator) registration that is expected to be resolved via Resolve call.Opens scope, also implies .Stores reused instance as WeakReference.Allows registering transient disposable.Turns On tracking of disposable transient dependency in parent scope or in open scope if resolved directly.Instructs to use parent reuse. Applied only if is not specified.Prevents disposal of reused instance if it is disposable.When single service is resolved, but multiple candidates found, this setting will be used to prefer this one.Does not add the resolution scope into the parent or singleton scope,
preventing possibly unwanted holding of the scope (and its services) for the lifespan of the container.Default setup for service factories.Constructs setup object out of specified settings.
If all settings are default then setup will be returned.
is metadata object or Func returning metadata object.
Does not add the resolution scope into the parent or singleton scope,
preventing possibly unwanted holding of the scope (and its services) for the lifespan of the container.Default setup which will look for wrapped service type as single generic parameter.Returns generic wrapper setup.
Default for is -1 for generic wrapper with single type argument.
Index need to be set for multiple type arguments. need to be set
when generic wrapper type arguments should be ignored.Default decorator setup: decorator is applied to service type it registered with.Creates setup with optional condition.
The specifies relative decorator position in decorators chain.
Greater number means further from decoratee - specify negative number to stay closer.
Decorators without order (Order is 0) or with equal order are applied in registration order
- first registered are closer decoratee.
Creates a condition for both , and additional condition
Setup for decorator of type .Setup for decorator of type .Service setup.Evaluates metadata if it specified as Func of object, and replaces Func with its result, otherwise just returns metadata object.Invocation of Func metadata is Not thread-safe. Please take care of that inside the Func.
All settings are set to the default.
Specify all the individual settings.
Setup applied for wrappers.Returns type.Delegate to get wrapped type from provided wrapper type.
If wrapper is generic, then wrapped type is usually a generic parameter.Per name.Delegate returning wrapped type from wrapper type. Overwrites other options.Default setup
Default is -1 for generic wrapper with single type argument.
Need to be set for multiple type arguments.
Returns generic wrapper setup.
Default for is -1 for generic wrapper with single type argument.
Index need to be set for multiple type arguments. need to be set
when generic wrapper type arguments should be ignored.Unwraps service type or returns the as-is.Setup applied to decorators.Returns Decorator factory type.If provided specifies relative decorator position in decorators chain.
Greater number means further from decoratee - specify negative number to stay closer.
Decorators without order (Order is 0) or with equal order are applied in registration order
- first registered are closer decoratee.Instructs to use decorated service reuse. Decorated service may be decorator itself.Default setup.Creates decorator setup with optional condition. applied to
decorated service to find that service is the decorator target. specifies
relative decorator position in decorators chain. Greater number means further from decoratee -
specify negative number to stay closer. Decorators without order (Order is 0) or with equal order
are applied in registration order - first registered are closer decoratee.Flags to describe how to deal with factory result expressionUp to DryIoc to decidePrevents DryIoc to set `DoNotCache`If set, the expression won't be cachedIf set then as resolution cache, it is for the internal use complementing the Setup.IsResolutionCallBase class for different ways to instantiate service:
Through reflection - Using custom delegate - Using custom expression - A placeholder for future actual implementation -
For all of the types Factory should provide result as and .
Factories are supposed to be immutable and stateless.
Each created factory has an unique ID set in .Get next factory ID in a atomic way.The ID.Unique factory id generated from static seed.Reuse policy for created services. The default is `null` which means the absense of the resue or TransientSetup may contain different/non-default factory settings.Indicates how to deal with the result expressionCan cache the result expressionInstructs to skip caching the factory unless it really wants to do so via `PleaseDontSetDoNotCache`Checks that condition is met for request or there is no condition setup.Shortcut for .Non-abstract closed implementation type. May be null if not known beforehand, e.g. in .Allow inheritors to define lazy implementation typeRegistration order.Settings (if any) to select Constructor/FactoryMethod, Parameters, Properties and Fields.The factory inserts the runtime-state into result expression, e.g. delegate or pre-created instance.Factory expression should be the resolution callClosed generic factoriesOpen-generic parent factoryReturns the closed-generic generated factory or `null`The main factory method to create a service expression, e.g. "new Client(new Service())".
If has specified, they could be used in expression.The method is the optimization, its behavior should be the same as the `CreateExpressionOrDefault`.
It accepts the service factory found by the collection or higher wrapper.
Here in the default implementation we just ignoring the passed factory.Returns service expression: either by creating it with or taking expression from cache.
Before returning method may transform the expression by applying , or/and decorators if found any.Applies reuse to created expression, by wrapping passed expression into scoped access
and producing the result expression.Creates factory delegate from service expression and returns it.Returns nice string representation of factory.Declares delegate to get single factory method or constructor for resolved request.Specifies how to get parameter info for injected parameter and resolved requestSpecifies what properties or fields to inject and how.DSL for specifying injection rules.Returns default service info wrapper for each parameter info.Returns service info which considers each parameter as optional.Combines source selector with other. Other is used as fallback when source returns null.Obsolete: please use Overrides source parameter rules with specific parameter details.
If it is not your parameter just return null.
Original parameters rules
Should return specific details or null.
New parameters rules.Adds to selector a service info for parameter identified by .Adds to selector a service info for parameter identified by
and apply the specified service details..Adds to selector a service info for parameter identified by
and assign the custom value to it.Adds to selector a service info for parameter identified by .
Original parameters rules. Name to identify parameter.
(optional) (optional)
(optional) By default throws exception if unresolved.
(optional) Specifies default value to use when unresolved.
(optional) Required metadata key Required metadata or value.
New parameters rules.Specify parameter by name and apply the specified service details.Specify parameter by name and assign the custom value to it.Adds to selector service info for parameter identified by type .
Source selector. The type of the parameter.
(optional) (optional)
(optional) By default throws exception if unresolved.
(optional) Specifies default value to use when unresolved.
(optional) Required metadata key Required metadata or value.
Combined selector.Adds to selector service info for parameter identified by type .Type of parameter. Source selector.
(optional) (optional)
(optional) By default throws exception if unresolved.
(optional) Specifies default value to use when unresolved.
(optional) Required metadata key Required metadata or value.
Combined selector.Specify parameter by type and set its details.Specify parameter by type and set custom value to it.Specify parameter by type and set custom value to it.
Original parameters rules.
The type of the parameter.
Custom value provider.
New parameters rules.DSL for specifying injection rules.Say to not resolve any properties or fields.Public assignable instance members of any type except object, string, primitives types, and arrays of those.Public, declared, assignable, non-primitive properties.Should return service info for input member (property or field).Generates selector property and field selector with settings specified by parameters.
If all parameters are omitted the return all public not primitive members.Combines source properties and fields with other. Other will override the source condition.
Source selector. Specific other selector to add.
Combined result selector.Obsolete: please use Specifies service details (key, if-unresolved policy, required type) for property/field with the name.
Original member selector. Member name. Details.
New selector.Adds to selector service info for property/field identified by .
Source selector. Name to identify member.
(optional) (optional)
(optional) By default returns default value if unresolved.
(optional) Specifies default value to use when unresolved.
(optional) Required metadata key Required metadata or value.
Combined selector.Specifies custom value for property/field with specific name.Returns true if property matches flags provided.
Property to match
Says to include non public properties.
Says to include properties of primitive type.
True if property is matched and false otherwise.Returns true if field matches flags provided.
Field to match.
Says to include non public fields.
Says to include fields of primitive type.
True if property is matched and false otherwise.Reflects on constructor parameters and members,
creates expression for each reflected dependency, and composes result service expression.Non-abstract service implementation type. May be open generic.Is `true` for `null` or some implementation type, but is `false` below in `WithAllDetails` for the type providerInjection rules set for Constructor/FactoryMethod, Parameters, Properties and Fields.Will contain factory ID of generator's factory for generated factory.Creates the memory-optimized factory based on argumentsCreates the memory-optimized factory based on argumentsCreates the memory-optimized factory based on argumentsCreates the factory based on argumentsRequired for the `WithAllDetails` factory belowCreates factory providing implementation type, optional reuse and setup.Creates service expression.Creates service expression using client provided expression factory delegate.ConstructorCreates service expression using client provided expression factory delegate.
Important! that it may use the already resolved service factory unwrapped by the higher wrapperCreates the factory out of provided delegate producing the expression based on the requestCreates the factory out of provided delegate producing the expression based on the request, and the setupCreates the factory out of provided delegate producing the expression based on the request, and the setup and/or setupConstructorWraps the instance in registryThe registered pre-created object instanceNon-abstract closed implementation type.Creates the memory-optimized factory from the supplied argumentsCreates the memory-optimized factory from the supplied argumentsCreates the factory.
Simplified specially for the register instance
Wraps the instance in expression constantSimplified path for the registered instanceUsed at resolution root too simplify getting the actual instanceThis factory is the thin wrapper for user provided delegate
and where possible it uses delegate directly: without converting it to expression.Creates the memory-optimized factory from the provided argumentsCreates the memory-optimized factory from the provided argumentsCreates the memory-optimized factory from the provided argumentsCreates the memory-optimized factory from the provided argumentsCreates the factory.Create expression by wrapping call to stored delegate with provided request.If possible returns delegate directly, without creating expression trees, just wrapped in .
If decorator found for request then factory fall-backs to expression creation.
Request to resolve.
Factory delegate directly calling wrapped delegate, or invoking expression if decorated.The placeholder for thr later resgitrationMay be used in places where placeholder is needed Always resolved asResolutionCall, to create a hole in object graph to be filled-in later by the runtime containerExplicit Transient reuse to avoid captive dependency error, e.g. if the Rules.Default reuse is Singleton
Explicit Transient reuse to avoid captive dependency error, e.g. if the Rules.Default reuse is Singleton
Should return value stored in scope
Lazy object storage that will create object with provided factory on first access,
then will be returning the same object for subsequent access.Parent scope in scope stack. Null for root scope.Optional name object associated with scope.True if scope is disposed.Looks up for stored item by id.
Create the value via `FactoryDelegate` passing the `IResolverContext`
Create the value via `FactoryDelegate` passing the `IResolverContext`
Creates, stores, and returns created item
Tracked item will be disposed with the scope. Smaller will be disposed first.Sets or adds the service item directly to the scope servicesSets (replaces) the used instance factory for the specified type.Try to retrieve factory or instance (wrapped in factory) via the Use method.The method will clone the scope factories and already created services,
but may or may not drop the disposables thus ensuring that only the new disposables added in clone will be disposedExtension methods for scopeThe method will clone the scope factories and already created services, including the tracked disposablesCheck if the service instance or factory is set to the scopeSets (replaces) instance to the scopeSets (replaces) instance to the scopeSets (replaces) instance in the scopeSets (replaces) instance in the scope
Scope is container to hold the shared per scope items and dispose items.
Scope uses Locking to ensure that the object factory called only once.
Parent scope in scope stack. Null for the root scope.Optional name associated with scope.True if scope is disposed.CreatingCreatingCreatingCreates scope with optional parent and name.The basic constructorThe amount of time to wait for the other party to create the scoped (or singleton) service.Can be used to manually add service for disposalTry retrieve the used instance from the scope.Enumerates all the parent scopes upwards starting from this one.Disposes all stored objects and empties item storage.
The disposal happens in REVERSE resolution / injection order, consumer first, dependency next.
It will allow consumer to do something with its dependency before it is disposed.All disposal exceptions are swallowed except the ContainerException,
which may indicate container misconfiguration.Prints scope info (name and parent) to string for debug purposes.Delegate to get new scope from old/existing current scope.
Old/existing scope to change.
New scope or old if do not want to change current scope.Provides ambient current scope and optionally scope storage for container,
examples are HttpContext storage, Execution context, Thread local.Returns current scope or null if no ambient scope available at the moment.Current scope or null.Changes current scope using provided delegate. Delegate receives current scope as input and
should return new current scope.
Delegate to change the scope.
Important: may be called multiple times in concurrent environment.
Make it predictable by removing any side effects.New current scope. So it is convenient to use method in "using (var newScope = ctx.SetCurrent(...))".Tracks one current scope per thread, so the current scope in different tread would be different or null,
if not yet tracked. Context actually stores scope references internally, so it should be disposed to free them.Provides static name for context. It is OK because its constant.Returns current scope in calling Thread or null, if no scope tracked.Change current scope for the calling Thread.Disposes the scopes and empties internal scope storage.Simplified scope agnostic reuse abstraction. More easy to implement,
and more powerful as can be based on other storage beside reuse.Relative to other reuses lifespan value.Optional name. Use to find matching scope by the name.
It also may be interpreted as object[] Names for matching with multiple scopes Returns true if reuse can be applied: may check if scope or other reused item storage is present.Returns composed expression.Returns container bound scope for storing singleton objects.Big lifespan.Relative to other reuses lifespan value.Returns true because singleton is always available.Returns expression call to GetOrAddItem.Pretty prints reuse name and lifespanSpecifies that instances are created, stored and disposed together with some scope.Less than Singleton'sRelative to other reuses lifespan value.Returns true if scope is open and the name is matching with reuse .Creates scoped item creation and access expression.Pretty prints reuse to string.Reuse string.Creates the reuse.Creates the reuse optionally specifying its name.Flag indicating that it is a scope or singleton.
Subject
Subject
Subject
Subject
Tracks the Unordered disposal in the current scope or in the singleton as fallback
Subject
Subject
Abstracts way to match reuse and scope namesDoes the job.Custom name matcher via the provided function.
It may be used as a negative check, e.g. to avoid cirtain scopes and proceed to search for the specific parent scope.Constucts the scope name matches based on the user-provided predicateThe match precicateRepresents multiple namesWraps multiple namesMatches all the name in a loop until first match is found, otherwise returns false.Holds the name for the resolution scope.Creates scope with specified service type and keyCreates scope with specified service type and key.Type of service opening the scope.Optional service key of service opening the scope.String representation for easy debugging and understood error messages.Specifies pre-defined reuse behaviors supported by container:
used when registering services into container with methods.Synonym for absence of reuse.Specifies to store single service instance per .Scoped to the any scope - either with or without the name.Scoped to the scope with the specified name only.
The `name` may be null, so the service will be scoped to any scope.Scoped to the scope with the specified name only.
The `name` may be null, so the service will be scoped to any scope. Specifies all the scope detailsScoped to the closest scope (in scope parent hierarchy) with the name from the specified names list.
The `names` should no contain the `null`[Obsolete("Use ScopedToService to prevent ambiguity with the ScopeTo(object name) where name is the Type")]Scoped to the scope created by the service with the specified type and optional keyScoped to the scope created by the service with the specified `TService` type and `serviceKey`,
The service should specify the creation of the scope in the registration call via `setup: Setup.With(opensResolutionScope: true)` argument.Scoped to the scope created by the service with the specified type and optional keyThe same as but in case of no scope available will fallback to the reuseThe is applied the same way as for reuse.Obsolete: same as .Obsolete: please use instead.Obsolete: please use `ScopedTo` instead.Obsolete: Please use `ScopedToService` instead.Obsolete: Please use `ScopedToService` instead.Same as Scoped but requires .A special name recognized by .
Note: The usage of the named scopes is the less performant than the unnamed ones. e.g. ASP.NET Core does not use the named scope.Obsolete: please prefer using `Scoped` without name instead.
The usage of the named scopes is the less performant than the unnamed ones. e.g. ASP.NET Core does not use the named scope.Policy to handle unresolved service.If service is unresolved for whatever means, the Resolve will throw the respective exception.If service is unresolved for whatever means, the Resolve will return the default value.If service is not registered, then the Resolve will return the default value, for the other errors it will throw.Declares minimal API for service resolution.
Resolve default and keyed is separated because of optimization for faster resolution of the former.Resolves default (non-keyed) service from container and returns created service object.
Service type to search and to return.
Says what to do if service is unresolved.
Created service object or default based on provided.Resolves service instance from container.
Service type to search and to return.
(optional) service key used for registering service.
(optional) Says what to do if service is unresolved.
(optional) Registered or wrapped service type to use instead of ,
or wrapped type for generic wrappers. The type should be assignable to return .
(optional) Dependency chain info.
(optional) To specify the dependency objects to use instead of resolving them from container.
Created service object or default based on parameter.Resolves all services registered for specified , or if not found returns
empty enumerable. If specified then returns only (single) service registered with this type.
Return type of an service item.
(optional) Resolve only single service registered with the key.
(optional) Actual registered service to search for.
Dependency resolution path info.
(optional) To specify the dependency objects to use instead of resolving them from container.
Enumerable of found services or empty. Does Not throw if no service found.Specifies options to handle situation when registered service is already present in the registry.Appends new default registration or throws registration with the same key.Throws if default or registration with the same key is already exist.Keeps old default or keyed registration ignoring new registration: ensures Register-Once semantics.Replaces old registration with new one.Adds the new implementation or null (Made.Of),
otherwise keeps the previous registration of the same implementation type.Decorator registration info.Registered factory.Decorator type.Creates info.Pretty-prints info into the string.Service registration info.Registered factory.Required service type.May be null for single default service, or for multiple default services.Provides registration order across all factory registrations in container.May be the same for factory registered with multiple services
OR for closed-generic factories produced from the single open-generic registration.Implementation type if available.Shortcut to property, useful to find all rootsShortcut to service info.Overrides the service type and pushes the original service type to required service typeOverrides the service type and pushes the original service type to required service typeCreates info. Registration order is figured out automatically based on Factory.Orders by registrationPretty-prints info into the string.Defines operations that for changing registry, and checking if something exist in registry.Rules for defining resolution/registration behavior throughout container.Registers factory in registry with specified service type and key for lookup.
Returns true if factory was added to registry, false otherwise. False may be in case of
setting and already existing factory
To register.
Service type as unique key in registry for lookup.
Service key as complementary lookup for the same service type.
Policy how to deal with already registered factory with same service type and key.
[performance] Confirms that service and implementation types are statically checked by compiler.
True if factory was added to registry, false otherwise.
False may be in case of setting and already existing factory.Returns true if expected factory is registered with specified service key and type.
Not provided or null means to check the
alone with any service key.Removes factory with specified service type and key from registry and cache.
BUT consuming services may still hold on the resolved service instance.
The cache of consuming services may also hold on the unregistered service. Use `IContainer.ClearCache` to clear all cache.Returns all registered service factories with their Type and optional Key.
Decorator and Wrapper types are not included.Returns the curretnly registered decorators. There maybe multiple entries for a specific DecoratorRegistrationInfo.DecoratorTy`pe`Searches for registered factories by type, and key (if specified),
and by factory type (by default uses ).
May return empty, 1 or multiple factories.Puts instance created via the passed factory on demand into the current or singleton scopeWhat to do with registrations when creating the new container from the existent one.Shares both registrations and resolution cache if anyClones the registrations but preserves the resolution cacheClones the registrations and drops the cache -- full reset!Combines registrator and resolver roles, plus rules and scope management.Creates new container from the current one by specifying the listed parameters.
If the null or default values are provided then the default or new values will be applied.
Nothing will be inherited from the current container.
If you want to inherit something you need to provide it as parameter.Creates new container from the current one by specifying the listed parameters.
If the null or default values are provided then the default or new values will be applied.
Nothing will be inherited from the current container. If you want to inherit something you need to provide it as parameter.Creates new container from the current one by specifying the listed parameters.
If the null or default values are provided then the default or new values will be applied.
Nothing will be inherited from the current container. If you want to inherit something you need to provide it as parameter.Produces new container which prevents any further registrations.
(optional)Controls what to do with registrations: ignore or throw exception.
Throws exception by default.
New container preserving all current container state but disallowing registrations.Searches for requested factory in registry, and then using .
Factory request.
Found factory, otherwise null if is set to .Searches for registered service factory and returns it, or null if not found.
Will use if specified.
Factory request.
Found factory or null.Finds all registered default and keyed service factories and returns them.
It skips decorators and wrappers.
Service type to look for, may be open-generic type too.
(optional) For generic serviceType instructs to look for
both closed and open-generic registrations.
Enumerable of found pairs.Returned Key item should not be null - it should be .The method will get all service factories registered and from the dynamic registration providers (if any) for the passed `serviceType`.
The method does not try to cache the dynamic provider factories and will be calling them every time.Searches for registered wrapper factory and returns it, or null if not found.
Service type to look for. Found wrapper factory or null.Faster lookups for the type and its generic type definition in the registered Wrappers.Returns all decorators registered for the service type.Returns all decorators registered for the service type.Creates decorator expression: it could be either Func{TService,TService},
or service expression for replacing decorators.
Decorated service request.
Decorator expression.If is generic type then this method checks if the type registered as generic wrapper,
and recursively unwraps and returns its type argument. This type argument is the actual service type we want to find.
Otherwise, method returns the input .
Type to unwrap. Method will return early if type is not generic.
Required service type or null if don't care.
Unwrapped service type in case it corresponds to registered generic wrapper, or input type in all other cases.If is generic type then this method checks if the type registered as generic wrapper,
and recursively unwraps and returns its type argument. This type argument is the actual service type we want to find.
Otherwise, method returns the input .Converts known items into custom expression or wraps in a constant expression.
Item to convert.
(optional) Type of item, otherwise item .
(optional) Throws for non-primitive and not-recognized items,
identifying that result expression require run-time state. For compiled expression it means closure in lambda delegate.
Returns constant or state access expression for added items.Clears cache for specified service(s). But does not clear instances of already resolved/created singletons and scoped services!
Target service type.
(optional) If not specified, clears cache for all .
(optional) If omitted, the cache will be cleared for all registrations of .
True if target service was found, false - otherwise.Puts instance created via the passed factory on demand into the current or singleton scopeResolves all registered services of type on demand,
when enumerator called. If service type is not found, empty returned.Service type to resolve.Exposes internal items enumerable.Wraps lazy resolved items. Lazy resolved items.
Return items enumerator.Wrapper type to box service with associated arbitrary metadata object.Service type.Arbitrary metadata object type.Value or object with associated metadata.Associated metadata object. Could be anything.Boxes value and its associated metadata together.Exception that container throws in case of error. Dedicated exception type simplifies
filtering or catching container relevant exceptions from client code.Error code of exception, possible values are listed in class.Simplifies the access to the error name.Many collected exceptionsCreates exception by wrapping and its message,
optionally with exception.Gets error message based on provided args.Prints argument for formatted message. To print. Printed string.Collects many exceptions.Creates exception with message describing cause and context of error.The optional additional exception data.Creates exception with details object and the message.Creates exception with message describing cause and context of error,
and leading/system exception causing it.The default exception message format.Allows the formatting of the final exception message.Tries to explain the specific exception based on the passed containerDefines error codes and error messages for all DryIoc exceptions (DryIoc extensions may define their own.)List of error messages indexed with code.Returns the name of error with the provided error code.Checked error condition, possible error sources.Unspecified, just throw.Predicate evaluated to false.Checked object is null.Checked object is of unexpected type.Checked type is not assignable to expected typeInvoked operation throws, it is source of inner exception.Just stores many collected exceptions.Enables more clean error message formatting and a bit of code contracts.Returns the default message specified for code.Declares mapping between type and code to specific .Returns matched exception for error check and error code.Throws matched exception with provided error code if throw condition is true.Throws matched exception with provided error code if throw condition is true.
Otherwise returns source .Throws exception if is null, otherwise returns .Throws exception if is not assignable to type specified by ,
otherwise just returns .Throws if is not assignable from .Invokes and in case of re-throws it as inner-exception.Just throws the exception with the code.Just throws the exception with the code.Throws instead of returning value of .
Supposed to be used in expression that require some return value.Throws if contidion is true, otherwise returns the `default(T)` valueThrows if contidion is true, otherwise returns the `default(T)` valueThrows the one with manyh collected exceptionsThrows the exception with info about the disposed scope and
the dispose stack trace if it is supported by resolver context.Print the d*mn exceptionCalled from the generated code to check if WeakReference.Value is GCed.Throws if the object is null.Contains helper methods to work with Type: for instance to find Type implemented base types and interfaces, etc.Preserves the stack trace before re-throwing.Flags for method.Include nor object not source type.Include source type to list of implemented types.Include type to list of implemented types.Returns all interfaces and all base types (in that order) implemented by .
Specify to include itself as first item and
type as the last item.Gets all declared and if specified, the base members too.Returns true if the contains all generic parameters
from .Where the `T` should be either Type or MethodInfoReturns true if class is compiler generated. Checking for CompilerGeneratedAttribute
is not enough, because this attribute is not applied for classes generated from "async/await".Returns true if type is closed generic: does not have open generic parameters, only closed/concrete ones.Returns true if type if open generic: contains at list one open generic parameter. Could be generic type definition as well.Returns generic type definition if type is generic and null otherwise.
[MethodImpl((MethodImplOptions)256)]
If type is array returns is element type, otherwise returns null.Checks if type is public or nested public in public type.Returns true if type is static.Returns true if type can be casted with conversion operators.Finds the conversion operator or returns null
Returns `target source.op_(Explicit|Implicit)(source)` or null if not found
Returns `target target.op_(Explicit|Implicit)(source)` or null if not found
Returns true if type is assignable to type.Returns true if type is assignable to type.`to` should be the closed-generic typeReturns true if type of is assignable to source .Returns true if provided type IsPrimitive in .Net terms, or enum, or string,
or array of primitives if is true.Returns all attributes defined on .Recursive method to enumerate all input type and its base types for specific details.
Details are returned by delegate.Returns all public instance constructors for the typeReturns all public instance constructors for the typeEnumerates all constructors from input type.Searches and returns the first constructor by its signature, e.g. with the same number of parameters of the same type.Searches and returns constructor by its signature.Searches and returns constructor by its signature, or throws if not foundReturns single constructor otherwise (if no constructor or more than one) returns null.Returns single constructor otherwise (if no or more than one) throws an exceptionLooks up for single declared method with the specified name. Returns null if method is not found.Looks for single declared (not inherited) method by name, and throws if not found.Looks up for method with and specified parameter types.Looks up for method with and specified parameter types.Returns property by name, including inherited. Or null if not found.Returns property by name, including inherited. Or null if not found.Returns field by name, including inherited. Or null if not found.Returns field by name, including inherited. Or null if not found.Returns type assembly.Is true for interface declared property explicitly implemented, e.g. IInterface.PropReturns true if member is static, otherwise returns false.
Find if property is static
Return either , or ,
.Returns true if field is backing field for property.Returns true if property is indexer: aka this[].Returns true if type is generated type of hoisted closure.Returns attributes defined for the member/method.Returns attributes defined for parameter.Get types from assembly that are loaded successfully.
Hacks the to get failing to load types metadata.Creates default(T) expression for provided .Optimized version of the map GetValueOrDefault for the Type key and object valueOptimized version of the map AddOrUpdate for the Type key and object valueProvides pretty printing/debug view for number of types.Default separator used for printing enumerable.Prints input object by using corresponding Print methods for know types.
Builder to append output to. Object to print.
(optional) Quote to use for quoting string object.
(optional) Separator for enumerable.
(optional) Custom type printing policy.
String builder with appended output.Appends string to string builder quoting with if provided.
String builder to append string to. String to print.
(optional) Quote to add before and after string.
String builder with appended string.Prints enumerable by using corresponding Print method for known item type.
String builder to append output to.
Items to print.
(optional) Custom separator if provided.
(optional) Custom item printer if provided.
String builder with appended output.Default delegate to print Type details: by default prints Type FullName and
skips namespace if it start with "System."Pretty prints the in proper C# representation.
Allows to specify if you want Name instead of FullName.Pretty-prints the typePorts some methods from .Net 4.0/4.5Portable version of Assembly.GetTypes or Assembly.DefinedTypes.Portable version of PropertyInfo.GetGetMethod.Portable version of PropertyInfo.GetSetMethod.Returns managed Thread ID either from Environment or Thread.CurrentThread whichever is available.Stores scopes propagating through async-await boundaries.Statically known name of root scope in this context.
It is fine to use a default instance, cause the async local scope are actually a static one
Returns current scope or null if no ambient scope available at the moment.Current scope or null.Changes current scope using provided delegate. Delegate receives current scope as input and should return new current scope.
Delegate to change the scope.
Important: may be called multiple times in concurrent environment.
Make it predictable by removing any side effects.New current scope. It is convenient to use method in "using (var newScope = ctx.SetCurrent(...))".Nothing to dispose.
Base type for messages
Type for an empty response
Single value of empty response
Single completed task for the empty response
Message extensions
Converts the task to empty response task
Message with empty response
Base message handler
Generic handler
Base message handler for message with empty response
Message handler middleware to handle the message and pass the result to the next middleware
`0` means the default registration order,
lesser numbers incuding the `-1`, `-2` mean execute as a first,
bigger numbers mean execute as a lastHandles message and passes to the next middleware
Base class for implementing async handlers
Base method to implement in your inheritor
Sequential middleware type of message handler decorator
Decorates message handler with optional middlewares
Composes middlewares with handler
Broadcasting type of message handler decorator
Constructs the hub with the handler and optional middlewares
Composes middlewares with handler
The central mediator entry-pointConstructs the mediatorSends the message with response to the resolved Single handlerSends the message with empty response to resolved Single handlerCommon abstraction to run the testsRuns the tests and should return the number of running testsThe base class and the Factpry methods provider for the Expression.Expression node type.All expressions should have a Type.You may use it whatever you like overloading for the specific value in your custom expression.Allows to overwrite the FEC stages to customize and optimize
the expression constant(label, blocks, tries) collection and il emitting phaseThe first FEC stage of expression traversal where closure information is collected including the
constant and the nested lambdas. Beside that the labels, block and try-catch information is also collected
for the next IL-emitting stage. The information regarding the currently traversed lambda expression
is accumulated in the `closure` structure. The `rootClosure` hold the first lambda expression info
for any nested lambda expression, which is indicated by `isNestedLambda`.The second FEC state to emit the actual IL op-codes based on the information collected by the first traversal
and available in the `closure` structure. Find the expression examples below by searching `IsIntrinsic => true`.Converts the LightExpression to the System Expression to enable fallback to the System CompileConverts to Expression and outputs its as stringReduces the Expression to simple onesVariable is not by-ref yetAvoids the boxing for all (two) bool valuesCreates a UnaryExpression that represents a bitwise complement operation.Creates a UnaryExpression that represents an explicit reference or boxing conversion where null is supplied if the conversion fails.Creates a UnaryExpression that represents an expression for obtaining the length of a one-dimensional array.Creates a UnaryExpression that represents a type conversion operation.Creates a UnaryExpression that represents a conversion operation for which the implementing method is specified.Creates a UnaryExpression that represents a conversion operation that throws an exception if the target type is overflowed.Creates a UnaryExpression that represents a conversion operation that throws an exception if the target type is overflowed and for which the implementing method is specified.Creates a UnaryExpression that represents the decrementing of the expression by 1.Creates a UnaryExpression that represents the incrementing of the expression value by 1.Returns whether the expression evaluates to false.Returns whether the expression evaluates to true.Creates a UnaryExpression, given an operand, by calling the appropriate factory method.Creates a UnaryExpression that represents an arithmetic negation operation.Creates a UnaryExpression that represents an arithmetic negation operation that has overflow checking.Returns the expression representing the ones complement.Creates a UnaryExpression that increments the expression by 1 and assigns the result back to the expression.Creates a UnaryExpression that represents the assignment of the expression followed by a subsequent increment by 1 of the original expression.Creates a UnaryExpression that decrements the expression by 1 and assigns the result back to the expression.Creates a UnaryExpression that represents the assignment of the expression followed by a subsequent decrement by 1 of the original expression.Creates a UnaryExpression that represents an expression that has a constant value of type Expression.Creates a UnaryExpression that represents a unary plus operation.Creates a UnaryExpression that represents an explicit unboxing. is ignored for now, the method is just for compatibility with SysExpressionCreates a BinaryExpression that represents applying an array index operator to an array of rank one.
A Expression to set the Left property equal to.
A Expression to set the Right property equal to.
A BinaryExpression that has the NodeType property equal to ArrayIndex and the Left and Right properties set to the specified values.Does not present in System Expression. Enables member assignment on existing instance expression.Creates a BinaryExpression that represents an assignment operation.Creates a BinaryExpression that represents raising an expression to a power and assigning the result back to the expression.Creates a BinaryExpression that represents an addition assignment operation that does not have overflow checking.Creates a BinaryExpression that represents an addition assignment operation that has overflow checking.Creates a BinaryExpression that represents a bitwise AND assignment operation.Creates a BinaryExpression that represents a bitwise OR assignment operation.Creates a BinaryExpression that represents a bitwise XOR assignment operation.Creates a BinaryExpression that represents a bitwise right-shift assignment operation.Creates a BinaryExpression that represents a remainder assignment operation.Creates a BinaryExpression that represents a subtraction assignment operation that does not have overflow checking.Creates a BinaryExpression that represents a subtraction assignment operation that has overflow checking.Creates a BinaryExpression that represents a multiplication assignment operation that does not have overflow checking.Creates a BinaryExpression that represents a multiplication assignment operation that has overflow checking.Creates a BinaryExpression that represents a division assignment operation that does not have overflow checking.Creates a BinaryExpression that represents an arithmetic addition operation that does not have overflow checking.Creates a BinaryExpression that represents an arithmetic addition operation that has overflow checking.Creates a BinaryExpression that represents a bitwise XOR operation.Creates a BinaryExpression that represents a bitwise left-shift operation.Creates a BinaryExpression that represents an arithmetic remainder operation.Creates a BinaryExpression that represents a bitwise right-shift operation.Creates a BinaryExpression that represents an arithmetic subtraction operation that does not have overflow checking.Creates a BinaryExpression that represents an arithmetic subtraction operation that has overflow checking.Creates a BinaryExpression that represents an arithmetic multiplication operation that does not have overflow checking.Creates a BinaryExpression that represents an arithmetic multiplication operation that has overflow checking.Creates a BinaryExpression that represents an arithmetic division operation.Creates a BinaryExpression that represents raising a number to a power.Creates a BinaryExpression that represents a bitwise AND operation.Creates a BinaryExpression that represents a conditional AND operation that evaluates the second operand only if the first operand evaluates to true.Creates a BinaryExpression that represents a bitwise OR operation.Creates a BinaryExpression that represents a conditional OR operation that evaluates the second operand only if the first operand evaluates to false.Creates a BinaryExpression that represents an equality comparison.Creates a BinaryExpression that represents an inequality comparison.Creates a BinaryExpression that represents a "greater than" numeric comparison.Creates a BinaryExpression that represents a "greater than or equal" numeric comparison.Creates a BinaryExpression that represents a "less than" numeric comparison.Creates a BinaryExpression that represents a " less than or equal" numeric comparison.Creates a LoopExpression with the given body and (optional) break target.Creates a LoopExpression with the given body.Creates a UnaryExpression that represents a throwing of an exception.Creates a UnaryExpression that represents a throwing of an exception with a given type.Creates a , given the left and right operands, by calling an appropriate factory method.Creates a BinaryExpression that represents a reference equality comparison.Creates a BinaryExpression that represents a reference inequality comparison.Creates a BinaryExpression that represents a coalescing operation.Creates a BinaryExpression that represents a coalescing operation.Creates a BinaryExpression that represents a coalescing operation, given a conversion function.Gets a value that indicates whether the expression tree node represents a lifted call to an operator whose return type is lifted to a nullable type.The base constant typeI want to see the actual Value not the default oneEnsures that there is no by-ref (in, our, ref) parameters in the constructor.
Which allows some optimizations when compiling the expression to the delegateFor indexer property or array access.Base Block expression with no variables and with Type of its last (Result) exporessionBlock with no variable but user-specified type.
Emits or clears a sequence point for debug information.
This allows the debugger to highlight the correct source code when
debugging.
The options for the compilerThe default options: Invocation lambda is inlined, no debug infoPrevents the inlining of the lambda in the Invocation expression to optimize for the multiple same lambda compiled onceAdds the Expression, ExpressionString, and CSharpString to the delegate closure for the debugging inspectionWhen the flag set then instead of the returning `null` the specific exceptionIndicates the not supported expression combinationMulti-dimensional array initializer is not supportedQuote is not supportedDynamic is not supportedRuntimeVariables is not supportedMemberInit MemberBinding is not supportedMemberInit ListBinding is not supportedGoto of the Return kind from the TryCatch is not supportedNot supported assignment target ExpressionType.TypeEqual is not supported FEC Not Supported exceptionThe reasonConstructorConstructorThe interface is implemented by the compiled delegate Target if `CompilerFlags.EnableDelegateDebugInfo` is set.The lambda expression object that was compiled to the delegateThe lambda expression construction syntax C# codeThe lambda expression equivalent C# codeCompiles expression to delegate ~20 times faster than Expression.Compile.
Partial to extend with your things when used as source file.Compiles lambda expression to TDelegate type. Use ifFastFailedReturnNull parameter to Not fallback to Expression.Compile, useful for testing.Compiles a static method to the passed IL Generator.
Could be used as alternative for `CompileToMethod` like this .
Check `IssueTests.Issue179_Add_something_like_LambdaExpression_CompileToMethod.cs` for example.Compiles lambda expression to delegate. Use ifFastFailedReturnNull parameter to Not fallback to Expression.Compile, useful for testing.Unifies Compile for System.Linq.Expressions and FEC.LightExpressionUnifies Compile for System.Linq.Expressions and FEC.LightExpressionCompiles lambda expression to TDelegate type. Use ifFastFailedReturnNull parameter to Not fallback to Expression.Compile, useful for testing.Compiles lambda expression to delegate. Use ifFastFailedReturnNull parameter to Not fallback to Expression.Compile, useful for testing.Compiles lambda expression to delegate. Use ifFastFailedReturnNull parameter to Not fallback to Expression.Compile, useful for testing.Compiles lambda expression to TDelegate type. Use ifFastFailedReturnNull parameter to Not fallback to Expression.Compile, useful for testing.Compiles lambda expression to delegate. Use ifFastFailedReturnNull parameter to Not fallback to Expression.Compile, useful for testing.Compiles lambda expression to TDelegate type. Use ifFastFailedReturnNull parameter to Not fallback to Expression.Compile, useful for testing.Compiles lambda expression to delegate. Use ifFastFailedReturnNull parameter to Not fallback to Expression.Compile, useful for testing.Compiles lambda expression to delegate. Use ifFastFailedReturnNull parameter to Not fallback to Expression.Compile, useful for testing.Compiles lambda expression to delegate. Use ifFastFailedReturnNull parameter to Not fallback to Expression.Compile, useful for testing.Compiles lambda expression to delegate. Use ifFastFailedReturnNull parameter to Not fallback to Expression.Compile, useful for testing.Compiles lambda expression to delegate. Use ifFastFailedReturnNull parameter to Not fallback to Expression.Compile, useful for testing.Compiles lambda expression to delegate. Use ifFastFailedReturnNull parameter to Not fallback to Expression.Compile, useful for testing.Compiles lambda expression to delegate. Use ifFastFailedReturnNull parameter to Not fallback to Expression.Compile, useful for testing.Compiles lambda expression to delegate. Use ifFastFailedReturnNull parameter to Not fallback to Expression.Compile, useful for testing.Compiles lambda expression to delegate. Use ifFastFailedReturnNull parameter to Not fallback to Expression.Compile, useful for testing.Tries to compile lambda expression to Tries to compile lambda expression to
with the provided closure object and constant expressions (or lack there of) -
Constant expression should be the in order of Fields in closure object!
Note 1: Use it on your own risk - FEC won't verify the expression is compile-able with passed closure, it is up to you!
Note 2: The expression with NESTED LAMBDA IS NOT SUPPORTED!
Note 3: `Label` and `GoTo` are not supported in this case, because they need first round to collect out-of-order labelsTries to compile lambda expression to
with the provided closure object and constant expressions (or lack there of)Tries to compile expression to "static" delegate, skipping the step of collecting the closure object.
Track the info required to build a closure object + some context information not directly related to closure.
Tracks that the last emit was an address
Tracks the stack of blocks where are we in emit phase
Map of the links between Labels and Goto's
Constant expressions to find an index (by reference) of constant expression from compiled expression.
Constant usage count and variable index.
It is a separate collection from the Constants because we directly convert later into the closure array
Parameters not passed through lambda parameter list But used inside lambda body.
The top expression should Not contain not passed parameters.
All nested lambda(s) `NestedLambdaInfo|NestedLambdaInfo[]` recursively nested in expression
Populates info directly with provided closure object and constants.
If provided, the is the const variable indexes,
should be the size of
LocalVar maybe a `null` in a collecting phase when we only need to decide if ParameterExpression is an actual parameter or variable
LocalVars maybe a `null` in collecting phase when we only need to decide if ParameterExpression is an actual parameter or variable
Collects the lambda info for the compilationThe lambda expressionThe lambda expression closure infoCompiled lambdaIndex of the compiled lambda in the parent lambda closure arrayConstructor
Helps to identify constants as the one to be put into the Closure
The minimal context-aware flags set by parent
Default is no flags
The result of expression is ignored and maybe popped out
Some parent is the call expression
Any Parent Expression is a MemberExpression
Some arithmetic operation
Subject
Expression with instance object (method call or member access or array access)
Subject
Subject
Combination`of InstanceAccess and Call
Constructor call
Indexer
Invoking the inlined lambda (the default System.Expression behavior)
Supports emitting of selected expressions, e.g. lambdaExpr are not supported yet.
When emitter find not supported expression it will return false from , so I could fallback
to normal and slow Expression.Compile.
Efficiently emit the int constant
Reflecting the internal methods to access the more performant for defining the local variableEfficiently returns the next variable index, hopefully without unnecessary allocations.
Prints the expression in its constructing syntax -
helpful to get the expression from the debug session and put into it the code for the test.
Prints the expression in its constructing syntax -
helpful to get the expression from the debug session and put into it the code for the test.
In addition, returns the gathered expressions, parameters ad labels.
Output the constant to C# string or should return `null`Converts the expression into the valid C# code representationTries hard to convert the expression into the correct C# codeTries hard to convert the expression into the correct C# codeTries hard to convert the expression into the correct C# codeConverts the into the proper C# representation.Prints valid C# BooleanPrints valid C# String escaping the thingsPrints valid C# Enum literalPrints many code items as the array initializer.Prints many code items as array initializer.
Prints a valid C# for known ,
otherwise uses passed or falls back to `ToString()`.
Helpers for functional composition
Always a true condition.
Identity function returning passed argument as result.
Forward pipe operator (`|>` in F#)
Forward pipe operator (`|>` in F#) with the additional state A for two arguments function
Cast to the R type with the forward pipe operator (`|>` in F#)
Forward pipe operator (`|>` in F#) but with side effect propagating the original `x` value
Forward pipe operator (`|>` in F#) but with side effect propagating the original `x` value and the state object
Lifts argument to Func without allocations ignoring the first argument.
For example if you have `Func{T, R} = _ => instance`,
you may rewrite it without allocations as `instance.ToFunc{A, R}`
Performant swapperHelpers for lazy instantiationsProvides result type inference for creation of lazy.Just a helper state with the number of mutable fields with the nice names ;) Maybe used together with Fold or other methods required stateAPuts the pooled instance back replacing the old onePuts the pooled instance back replacing the old onePuts the pooled instance back replacing the old oneJust a helper state with the number of mutable fields with the nice names ;) Maybe used together with Fold or other methods required stateABPuts the pooled instance back replacing the old onePuts the pooled instance back replacing the old onePuts the pooled instance back replacing the old onePuts the pooled instance back replacing the old oneState factory and helper methodsCreates the state out of the passed argumentsAtomically pops the pooled instance (if exist) or creates the new one and sets the fields to the passed argumentsCreates the state out of the passed argumentsAtomically pops the pooled instance (if exist) or creates the new one and sets the fields to the passed argumentsMethods to work with immutable arrays and some sugar.Returns singleton empty array of provided type.Array item type.Empty array.Wraps item in array.Returns true if array is null or have no items.Type of array item.
Source array to check. True if null or has no items, false otherwise.Returns empty array instead of null, or source array otherwise.Type of array item.
Returns source enumerable if it is array, otherwise converts source to array or an empty array if null.
Returns source enumerable if it is list, otherwise converts source to IList or an empty array if null.
Array copyFast array copy without checking the items for the null or the emptynessReturns the new array consisting from all items from source array then the all items from added array.
If source is null or empty then the added array will be returned. If added is null or empty then the source will be returned.Performant concat of enumerables in case of arrays. But performance will degrade if you use Concat().Where().Returns new array with appended,
or at , if specified.
If source array could be null or empty, then single value item array will be created despite any index.Updates the item in the copy of the array. The array should be non-empty.Returns the new array consisting from all items from source array then the all items from added array.
Assumes that both arrays are non-empty to avoid the checks.Returns the new array consisting from all items from source array plus the value.Returns new array with appended. Assumes that `source` is not empty to avoid the checks.Returns new array with prepended. Assumes that `source` is not empty to avoid the checks.Calls predicate on each item in array until predicate returns true,
then method will return this item index, or if predicate returns false for each item, method will return -1.Minimizes the allocations for closure in predicate lambda with the provided Looks up for item in source array equal to provided value, and returns its index, or -1 if not found.The same as `IndexOf` but searching for the item by referenceProduces new array without item at specified .
Will return array if index is out of bounds, or source is null/empty.Looks for item in array using equality comparison, and returns new array with found item remove, or original array if not item found.Returns first item matching the , or default item value.Version of FindFirst with the fixed state used by predicate to prevent allocations by predicate lambda closureReturns first item matching the , or default item value.Returns element if collection consist on single element, otherwise returns default value.
It does not throw for collection with many elementsDoes for each itemCopies the slice to the new array, just a sugar extension methodAppends the slice from the source to the end of the results array possibly the resizing the results to accomodate the sliceWhere method similar to Enumerable.Where but more performant and non necessary allocating.
It returns source array and does Not create new one if all items match the condition.Match with the additional state to use in to minimize the allocations
in lambda closureMatch with the additional state to use in to minimize the allocations
in lambda closureWhere method similar to Enumerable.Where but more performant and non necessary allocating.
It returns source array and does Not create new one if all items match the condition.Match with the additional state to use in and
to minimize the allocations in lambda closure Match with the additional state to use in and
to minimize the allocations in lambda closure Maps all items from source to result array.Source item typeResult item type
Source items Function to convert item from source to result.
Converted items
Map with additional state to use in to minimize allocations in lambda closure
Map with additional two states to use in to minimize allocations in lambda closure
Maps all items from source to result collection. If possible uses fast array Map otherwise Enumerable.Select.Source item typeResult item type
Source items Function to convert item from source to result.
Converted itemsIf is array uses more effective Match for array, otherwise just calls WhereType of source items.
If null, the null will be returned.
Condition to keep items.
Result items, may be an array.If is array uses more effective Match for array,
otherwise just calls Where, SelectType of source items.Type of result items.
If null, the null will be returned.
Condition to keep items. Converter from source to result item.
Result items, may be an array.Wrapper that provides optimistic-concurrency Swap operation implemented using .Type of object to wrap.Gets the wrapped value.Creates ref to object, optionally with initial value provided.
(optional) Initial value.
Exchanges currently hold object with - see for details.
Delegate to produce new object value from current one passed as parameter.
Returns old object value the same way as Important: May be called multiple times to retry update with value concurrently changed by other code.Swap with the additional state required for the delegate .
May prevent closure creation for the delegateSwap with the additional state , required for the delegate .
May prevent closure creation for the delegateSwap with the additional state required for the delegate .
May prevent closure creation for the delegateJust sets new value ignoring any intermingled changes and returns the original valueold valueDirectly sets the value and returns the new valueCompares current Referred value with and if equal replaces current with True if current value was replaced with new value, and false if current value is outdated (already changed by other party).[!CDATA[
var value = SomeRef.Value;
if (!SomeRef.TrySwapIfStillCurrent(value, Update(value))
SomeRef.Swap(v => Update(v)); // fallback to normal Swap with delegate allocation
]]Just sets the new valueProvides optimistic-concurrency consistent operation.
The default max retry count - can be overridden by `Swap` optional parameter
Factory for with type of value inference.Type of value to wrap.
Initial value to wrap.
New ref.Creates new ref to the value of original ref.Ref value type.
Original ref. New ref to original value.First, it evaluates new value using function.
Second, it checks that original value is not changed.
If it is changed it will retry first step, otherwise it assigns new value and returns original (the one used for ).Type of value to swap.
Reference to change to new value
Delegate to get value from old one.
(optional)
Old/original value. By analogy with .Important: May be called multiple times to retry update with value concurrently changed by other code.Swap with the additional state required for the delegate .
May prevent closure creation for the delegateSwap with the additional state required for the delegate .
May prevent closure creation for the delegateSwap with the additional state , required for the delegate .
May prevent closure creation for the delegateSwap with the additional state , , required for the delegate .
May prevent closure creation for the delegatePrintable thing via provided printer Print to the provided string builder via the provided printer.Produces good enough hash codes for the fieldsCombines hashes of two fieldsInspired by System.Tuple.CombineHashCodes
Simple unbounded object pool
Give me an objectGive it backImmutable Key-Value pair. It is reference type (could be check for null),
which is different from System value type .
In addition provides and implementations.Type of Key.Type of Value.Key.Value.Creates Key-Value object by providing key and value. Does Not check either one for null.
key.value.
Creates nice string view.String representation.Returns true if both key and value are equal to corresponding key-value of other object.Combines key and value hash codeHelpers for .Creates the key value pair.Creates the pair with the new value
Simple helper for creation of the pair of two parts.
Pairs key with value.
Helper structure which allows to distinguish null value from the default value for optional parameter.Allows to transparently convert parameter argument to opt structure.Argument value.Indicates that value is provided.Wraps passed value in structure. Sets the flag that value is present.Helper to get value or default value if value is not present.Ever growing list methodsDefault initial capacity
Push the new slot and return the ref to it
Adds the new item possibly extending the item collection
Expands the items starting with 2Creates the final array out of the list, so that you cannot use after that!Ever growing listDefault initial capacity The items arrayThe countConstructs the thingPush the new slot and return the ref to itAdds the new item possibly extending the item collectionPops the item - just moving the counter backCreates the final array out of the list, so that you cannot use after that!Pops the item - just moving the counter backImmutable list - simplest linked list with the Head and the Tail.Empty list to Push to.True for empty list.First value in a list.The rest of values or Empty if list has a single value.Prepends new value and returns new list.Enumerates the list.String representation for debugging purposesExtension methods providing basic operations on a list.
Split list into (Head, Tail, IsEmpty) tuple
Constructs the reversed list from the parameter array of items
Constructs the list as the reversed input list
Constructs the list as the reversed enumerable
Constructs list of one elementConstructs list from head and tailApples some effect action to each elementFold list to a single value. The respective name for it in LINQ is AggregateFold list to a single value with index of item. The respective name for it in LINQ is Aggregate.Returns new list in reverse order.Maps the items from the first list to the result list.Maps with indexCopies list to array.
Zipper is an immutable persistent data structure, to represent collection with single focused (selected, active) element.
Consist of REVERSED `Left` immutable list, `Focus` element, and the `Right` immutable list. That's why a Zipper name,
where left and right part are joined / zipped in focus item.
Empty singleton instance to start building your zipper
True is zipper does not contain items
Index of Focus item, from `0` to `Count-1`
Number of items
Left REVERSED list, so the Head of the list is just prior the Focus item
Right list, where Head is just after the Focus item
Single focus item
Sets a new focus and pushes the old focus to the Left list.
Sets a new focus and pushes the old focus to the Left list.
Sets a new focus and pushes the old focus to the right list.
Sets a new focus and pushes the old focus to the right list.
Removes a focus, filling the hole with the item from the left list, or from the right if the left is empty
Removes a focus, filling the hole with the item from the right list, or from the left if the right is empty
Shifts focus one element to the left (decrementing its Index).
Shifts focus one element to the right (incrementing its Index).
Sets a new focus and returns a new zipper with the left and right lists unchanged
Maps over the zipper items producing a new zipper
Maps over the zipper items with item index, producing a new zipper
Other ImZipper methods
Appends array items to zipper
Converts to array.
Shifts focus to a specified index, e.g. a random access
Updates a focus element if it is present, otherwise does nothing.
If the focus item is the equal one, then returns the same zipper back.
Update the item at random index, by shifting and updating it
Update the item at random index, by shifting and updating it
Folds zipper to a single value
Folds zipper to a single value by using an item index
Apply some effect action on each element
Given the old value should and the new value should return result updated value.
Update handler including the key
Entry containing the Key and Value in addition to the HashThe keyThe value. Maybe modified if you need the Ref{Value} semantics.
You may add the entry with the default Value to the map, and calculate and set it later (e.g. using the CAS).Constructs the entry with the key and valueConstructs the entry with the key and valueThe composite containing the list of entries with the same conflicting Hash.The base and the holder class for the map tree leafs and branches, also defines the Empty tree.
The map implementation is based on the "modified" 2-3 tree.Hide the base constructor to prevent the multiple Empty trees creationEmpty map to start with. Exists as a single instance.Prints the map tree in JSON-ish format in release mode and enumerates the keys in DEBUG.Indicates that the map is emptyThe count of entries in the mapLookup for the entry by hash. If nothing the method returns `null`Returns the found entry with the same hash or the new map with added new entry.
Note that the empty map will return the entry the same as if the entry was found - so the consumer should check for the empty map.
Note that the method cannot return the `null` - when the existing entry is not found it will always be the new map with the added entry.Returns the new map with old entry replaced by the new entry. Note that the old entry should be present.Removes the certainly present old entry and returns the new map without it.The delegate is supposed to return entry different from the oldEntry to update, and return the oldEntry to keep it.The base map entry for holding the hash and payloadThe HashConstructs the entry with the hashLookup for the entry by Hash and KeyUpdating the entry with the new oneUpdating the entry with the new one using the `update` methodLeaf with 2 hash-ordered entries. Important: the both or either of entries may be null for the removed entriesThe leaf containing the Leaf2 plus the newest added entry.Leaf with the Leaf2 plus added entry, plus added entryLeaf with 5 hash-ordered entriesLeaf with 5 existing ordered entries plus 1 newly added entry.Leaf with 5 existing ordered entries plus 1 newly added, plus 1 newly added.Branch of 2 leafs or branches with entry in the middleBranch of 3 with 2 nodes in betweenEntry containing the Value in addition to the HashThe hash.The Key is actually the Hash for this entry and the vice versa.The value. Maybe modified if you need the Ref{Value} semantics.
You may add the entry with the default Value to the map, and calculate and set it later (e.g. using the CAS).Constructs the entry with the default valueConstructs the entry with the valueThe base and the holder class for the map tree leafs and branches, also defines the Empty tree.
The map implementation is based on the "modified" 2-3 tree.Hide the base constructor to prevent the multiple Empty trees creationEmpty map to start with. Exists as a single instance.Prints the map tree in JSON-ish format in release mode and enumerates the keys in DEBUG.Indicates that the map is emptyThe count of entries in the map`true` if node is branchLookup for the entry by hash.
You need to check the returned entry type because it maybe the `HashConflictKeyValuesEntry` which contain multiple key value entries for the same hash. For the `int` key you may be sure that the `ImHashMapEntry{V}` is always returned.
If nothing the method returns `null`Returns the found entry with the same hash or the new map with added new entry.
Note that the empty map will return the entry the same as if the entry was found - so the consumer should check for the empty map.
Note that the method cannot return the `null` - when the existing entry is not found it will always be the new map with the added entry.Returns the new map with old entry replaced by the new entry.
Note that the old entry should be present.Removes the certainly present old entry and returns the new map without it.Leaf with 2 hash-ordered entries. Important: the both or either of entries may be null for the removed entriesThe leaf containing the Leaf2 plus the newest added entry.Leaf with the Leaf2 plus added entry, plus added entryLeaf with 5 hash-ordered entriesLeaf with 5 existing ordered entries plus 1 newly added entry.Leaf with 5 existing ordered entries plus 1 newly added, plus 1 newly added.The 2 branches with the node in betweenThe 2 branches with the node in betweenThe 3 branches with the 2 nodes in betweenHelper stack wrapper for the arrayCreates the list of the `DefaultInitialCapacity`Pushes the itemGets the item by indexHelper stack wrapper for the arrayEntry in a stackThe next entry to traverseThe next branch to traverseThe itemsCreates the list of the `DefaultInitialCapacity`Pushes the itemThe map methodsCreates the entry to help with inferenceCreates the entry to help with inferenceCreates the conflicting entry out of two entriesSets the value and returns the entryEnumerates all the map entries in the hash order.
The `parents` parameter allow sto reuse the stack memory used for traversal between multiple enumerates.
So you may pass the empty `parents` into the first `Enumerate` and then keep passing the same `parents` into the subsequent `Enumerate` calls
Depth-first in-order of hash traversal as described in http://en.wikipedia.org/wiki/Tree_traversal.
The `parents` parameter allows to reuse the stack memory used for the traversal between multiple calls.
So you may pass the empty `parents` into the first `Enumerate` and then keep passing the same `parents` into the subsequent callsDo something for each entry.
The `parents` parameter allows to reuse the stack memory used for the traversal between multiple calls.
So you may pass the empty `parents` into the first `Enumerate` and then keep passing the same `parents` into the subsequent callsCollect something for each entry.
The `parents` parameter allows to reuse the stack memory used for the traversal between multiple calls.
So you may pass the empty `parents` into the first `Enumerate` and then keep passing the same `parents` into the subsequent callsConverts map to an array with the minimum allocationsConverts map to an array with the minimum allocationsConverts the map to the dictionaryGet the key-value entry if the hash and key is in the map or the default `null` value otherwise.Get the key-value entry if the hash and key is in the map or the default `null` value otherwise.Get the key value entry if the key is in the map or the default `null` value otherwise.Returns if map contains the hash and key, otherwise returns Returns if map contains the key, otherwise returns Returns the entry ASSUMING it is present otherwise its behavior is UNDEFINED.
You can use the method after the Add and Update methods on the same map instance - because the map is immutable it is for sure contains added or updated entry.Lookup for the value by the key using the hash and checking the key with the `object.Equals` for equality,
returns the default `V` if hash, key are not found.Lookup for the value by key using its hash and checking the key with the `object.Equals` for equality,
returns the default `V` if hash, key are not found.Lookup for the value by the key using the hash and checking the key with the `object.ReferenceEquals` for equality,
returns found value or the default value if not foundLookup for the value by the key using the hash and checking the key with the `object.Equals` for equality,
returns the `true` and the found value or the `false` otherwiseLookup for the value by the key using the hash and checking the key with the `object.ReferenceEquals`,
returns the `true` and the found value or the `false` otherwiseLookup for the value by the key using its hash and checking the key with the `object.Equals` for equality,
returns the `true` and the found value or the `false` otherwiseAdds the entry and returns the new map or if the hash is present then return the found entry or the newEntry if the map is empty,
so you may check the result like this `if (res is ImMapEntry<V> entry && entry != newEntry)`Adds or updates (no in-place mutation) the map with value by the passed hash and key, always returning the NEW map!Adds or updates (no in-place mutation) the map with the new entry, always returning the NEW map!Adds or updates (no in-place mutation) the map with value by the passed key, always returning the NEW map!Adds or updates (no in-place mutation) the map with value by the passed key, always returning the NEW map!Updates the possibly the conflicted entry with the new key and value entry using the provided update function.Adds or updates (no in-place mutation) the map with value by the passed key, always returning the NEW map!Updates the map with the new value if the key is found otherwise returns the same unchanged map.Updates the map with the new value if the key is found otherwise returns the same unchanged map.Updates the map with the new value if the key is found otherwise returns the same unchanged map.Updates the map with the new value if the key is found otherwise returns the same unchanged map.Updates the map with the new value and the `update` function if the key is found otherwise returns the same unchanged map.
If `update` returns the same map if the updated result is the sameUpdates the map with the new value and the `update` function if the key is found otherwise returns the same unchanged map.
If `update` returns the same map if the updated result is the sameProduces the new map with the new entry or keeps the existing map if the entry with the key is already presentProduces the new map with the new entry or keeps the existing map if the entry with the key is already presentProduces the new map with the new entry or keeps the existing map if the entry with the key is already presentReturns the new map without the specified hash and key (if found) or returns the same map otherwiseReturns the new map without the specified hash and key (if found) or returns the same map otherwiseThe map methodsCreates the entry to help with inferenceNon-allocating enumeratorConstructorReturns non-allocating enumeratorEnumerator on stack, without allocationEnumerates all the map entries in the hash order.
`parents` parameter allows to reuse the stack memory used for traversal between multiple enumerates.
So you may pass the empty `parents` into the first `Enumerate` and then keep passing the same `parents` into the subsequent `Enumerate` callsDepth-first in-order of hash traversal as described in http://en.wikipedia.org/wiki/Tree_traversal.
The `parents` parameter allows to reuse the stack memory used for the traversal between multiple calls.
So you may pass the empty `parents` into the first `Enumerate` and then keep passing the same `parents` into the subsequent callsDo something for each entry.
The `parents` parameter allows to reuse the stack memory used for the traversal between multiple calls.
So you may pass the empty `parents` into the first `Enumerate` and then keep passing the same `parents` into the subsequent callsCollect something for each entry.
The `parents` parameter allows to reuse the stack memory used for the traversal between multiple calls.
So you may pass the empty `parents` into the first `Enumerate` and then keep passing the same `parents` into the subsequent callsConverts the map to an array with the minimum allocationsConverts the map to an array with the minimum allocationsConverts the map to the dictionaryReturns the entry ASSUMING it is present otherwise its behavior is UNDEFINED.
You can use the method after the Add and Update methods on the same map instance - because the map is immutable it is for sure contains added or updated entry.Lookup for the entry by hash, returns the found entry or `null`.Lookup for the value by hash, returns the default `V` if hash is not found.Lookup for the value by its hash, returns the `true` and the found value or the `false` otherwiseAdds the entry and returns the new map or if the hash is present then return the found entry or the newEntry if the map is empty,
so you may check the result like this `if (res is ImMapEntry<V> entry && entry != newEntry)`Adds or updates (no in-place mutation) the map with the new entry, always returning the NEW map!Adds or updates (no in-place mutation) the map with value by the passed hash and key, always returning the NEW map!Adds or updates (no in-place mutation) the map with value by the passed hash and key, always returning the NEW map!Updates the map with the new value if the hash is found otherwise returns the same unchanged map.Updates the map with the default value if the hash is found otherwise returns the same unchanged map.Produces the new map with the new entry or keeps the existing map if the entry with the key is already presentProduces the new map with the new entry or keeps the existing map if the entry with the hash is already presentReturns the new map without the specified hash (if found) or returns the same map otherwise
The fixed array of maps (partitions) where the key first (lower) bits are used to locate the partion to lookup into.
Note: The partition array is NOT immutable and operates by swapping the updated partition with the new one.
The number of partitions may be specified by user or you can use the default number 16.
The default number 16 was selected to be not so big to pay for the few items and not so small to diminish the use of partitions.
The default number of partitionsThe default mask to partition the keyCreates the new collection with the empty partionsLookup for the value by the key using the hash and checking the key with the `object.Equals` for equality,
returns the default `V` if hash, key are not found.Lookup for the value by the key using the hash and checking the key with the `object.ReferenceEquals` for equality,
returns found value or the default value if not foundLookup for the value by the key using its hash and checking the key with the `object.Equals` for equality,
returns the default `V` if hash, key are not found.Lookup for the value by the key using the hash code and checking the key with the `object.Equals` for equality,
returns the `true` and the found value or the `false`Lookup for the value by the key using its hash code and checking the key with the `object.Equals` for equality,
returns the `true` and the found value or the `false`Lookup for the value by the key using the hash code and checking the key with the `object.ReferenceEquals` for equality,
returns the `true` and the found value or the `false`Lookup for the value by the key using its hash and checking the key with the `object.ReferenceEquals` for equality,
returns the default `V` if hash, key are not found.Returns the SAME partitioned maps array instance but with the NEW added or updated partionReturns the SAME partitioned maps array instance but with the NEW added or updated partionReturns the SAME partitioned maps array instance but with the NEW added or updated partionReturns the SAME partitioned maps array instance but with the NEW added or the same kept partionReturns the SAME partitioned maps array instance but with the NEW added or the same kept partionDo something for each entry.
The `parents` parameter allows to reuse the stack memory used for the traversal between multiple calls.
So you may pass the empty `parents` into the first `Enumerate` and then keep passing the same `parents` into the subsequent callsDo something for each entry.
The `parents` parameter allows to reuse the stack memory used for the traversal between multiple calls.
So you may pass the empty `parents` into the first `Enumerate` and then keep passing the same `parents` into the subsequent calls
The fixed array of maps (partitions) where the key first (lower) bits are used to locate the partion to lookup into.
Note: The partition array is NOT immutable and operates by swapping the updated partition with the new one.
The number of partitions may be specified by user or you can use the default number 16.
The default number 16 was selected to be not so big to pay for the few items and not so small to diminish the use of partitions.
The default number of partitionsThe default mask to partition the keyCreates the new collection with the empty partionsLookup for the value by the key using its hash, returns the default `V` if hash is not found.Lookup for the value by the key using the hash, returns the `true` and the found value or the `false`Returns the SAME partitioned maps array instance but with the NEW added or updated partionReturns the SAME partitioned maps array instance but with the NEW added or updated partionReturns the SAME partitioned maps array instance but with the NEW added or the same kept partionUpdates the map with the new value if the hash is found otherwise returns the same unchanged map.Do something for each entry.
The `parents` parameter allows to reuse the stack memory used for the traversal between multiple calls.
So you may pass the empty `parents` into the first `Enumerate` and then keep passing the same `parents` into the subsequent callsDo something for each entry.
The `parents` parameter allows to reuse the stack memory used for the traversal between multiple calls.
So you may pass the empty `parents` into the first `Enumerate` and then keep passing the same `parents` into the subsequent calls