Skip to content

ControllerConvention update for StructureMap 4Β #15

@JenTechSystems

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());
            }
        });
    }

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