Skip to content

ControllerConvention update for StructureMap 4 #15

Description

@JenTechSystems

With the release of StructureMap4 it appears that the ControllerConvention registration class requires a minor update.

This is how I have changed it, not sure if this is the best way to go:

    public void ScanTypes(TypeSet types, Registry registry)
    {
        types.AllTypes().ForEach(type =>
        {
            if (type.CanBeCastTo<Controller>() && !type.IsAbstract)
            {
                registry.For(type).LifecycleIs(new UniquePerRequestLifecycle());
            }
        });
    }

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions