Skip to content

Flowing scope can't resolve IEnumerable<T>, where resolving T[] works #1027

@dotnetjunkie

Description

@dotnetjunkie
  • Simple Injector latest version
  • Configured using ScopedLifestyle.Flowing
  • Transient services registered as collection
  • Those transient services have scoped dependencies

In this context, when the collection is resolved from the Scope it fails when resolved as IEnumerable<T> but succeeds when resolved as T[].

Exception message:

ServiceX is registered using the 'Scoped' lifestyle, but the instance is requested outside the context of an active (Scoped) scope. Please see https://simpleinjector.org/scoped for more information about how apply lifestyles and manage scopes.'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions