Skip to content

Commit

Permalink
Fixup docs
Browse files Browse the repository at this point in the history
  • Loading branch information
z4kn4fein committed Dec 20, 2024
1 parent 69666ee commit 6a5fa66
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [v5.10.1] - 2023-06-09
### Added
- `ParentDependency` flag for `ResolutionBehavior`. It indicates that parent containers (including indirect all ancestors) can only provide dependencies for services that are already selected for resolution.
- `ParentDependency` flag for `ResolutionBehavior`. It indicates that parent containers (including all indirect ancestors) can only provide dependencies for services that are already selected for resolution.
### Fixed
- During factory resolution, the type map check failed for registrations like: `.Register<IService>(c => c.WithFactory(/* ... */).AsServiceAlso<IAnother>())`. Now, the container gets the implementation type from the generic context where it's possible.

## [v5.10.0] - 2023-06-04
### Changed
- Each `Resolve()` method now accepts a `ResolutionBehavior` flag parameter. It determines which level of the container hierarchy can take part in the service resolution. Possible values:
- `Parent`: Indicates that parent containers (including indirect all ancestors) can participate in the resolution request's service selection.
- `Parent`: Indicates that parent containers (including all indirect ancestors) can participate in the resolution request's service selection.
- `Current`: Indicates that the current container (which initiated the resolution request) can participate in the service selection.
- `Default`: The default behavior, it's used when the parameter is not specified. Its value is `Parent | Current`, so the parents and the current (which initiated the resolution request) container can participate in the resolution request's service selection.
- `CreateChildContainer()` now accepts an `attachToParent` boolean parameter, which indicates whether the parent container's disposal should also dispose the child. It defaults to `true`.
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/advanced/child-containers.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ foreach (var child in container.ChildContainers)
You can control which level of the container hierarchy can participate in the service resolution with the `ResolutionBehavior` parameter.

Possible values:
- `Default`: The default behavior, it's used when the parameter is not specified. Its value is `Parent | Current`, so the parents and the current container (which initiated the resolution request) can participate in the resolution request's service selection.
- `Parent`: Indicates that parent containers (including indirect all ancestors) can participate in the resolution request's service selection.
- `Default`: The default behavior, it's used when the parameter is not specified. Its value is `Parent | Current`, so both the current container (which initiated the resolution request) and its parents can participate in the resolution request's service selection.
- `Parent`: Indicates that parent containers (including all indirect ancestors) can participate in the resolution request's service selection.
- `Current`: Indicates that the current container (which initiated the resolution request) can participate in the service selection.
- `ParentDependency`: Indicates that parent containers (including indirect all ancestors) can only provide dependencies for services that are already selected for resolution.
- `ParentDependency`: Indicates that parent containers (including all indirect ancestors) can only provide dependencies for services that are already selected for resolution.
- `PreferEnumerableInCurrent`: Upon enumerable resolution, services from the current container (which initiated the resolution request) are preferred, ignoring services from parent containers.

```csharp
Expand Down
6 changes: 3 additions & 3 deletions src/Resolution/ResolutionBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ namespace Stashbox.Resolution;
public enum ResolutionBehavior

Check warning on line 10 in src/Resolution/ResolutionBehavior.cs

View workflow job for this annotation

GitHub Actions / Run analysis & code coverage

Rename this enumeration to match the regular expression: '^([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?s$'. (https://rules.sonarsource.com/csharp/RSPEC-2342)
{
/// <summary>
/// Indicates that both the parents and the current (which initiated the resolution request) container can participate in the resolution request's service selection.
/// Indicates that both the current container (which initiated the resolution request) and its parents can participate in the resolution request's service selection.
/// </summary>
Default = Current | Parent,

/// <summary>
/// Indicates that parent containers (including indirect all ancestors) can participate in the resolution request's service selection.
/// Indicates that parent containers (including all indirect ancestors) can participate in the resolution request's service selection.
/// </summary>
Parent = 1 << 0,

Expand All @@ -25,7 +25,7 @@ public enum ResolutionBehavior
Current = 1 << 1,

/// <summary>
/// Indicates that parent containers (including indirect all ancestors) can only provide dependencies for services that are already selected for resolution.
/// Indicates that parent containers (including all indirect ancestors) can only provide dependencies for services that are already selected for resolution.
/// </summary>
ParentDependency = 1 << 2,

Expand Down

0 comments on commit 6a5fa66

Please sign in to comment.