Skip to content

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

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.'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions