/
IOC Container Decision and Changes

IOC Container Decision and Changes

Castle Windsor

The castle team has struggled getting net core support for Windsor. The did end up creating a facility that is prone to memory leaks and it does not function very well with the built in container created by the net core team. Currently there is no path for net core 3.1 as there is no maintainer for the facility.

Built in container (ServicesCollection)

The net core team has created their own specific container. The application is opinionated and requires the use of the container for registering the controllers, and middle ware using this container. It is lacking though, there is no specific way of using decorators, and/or assembly scanning. Also there is no ability to use named registrations. Scrutor is an extension to the default container that allows for assembly scanning and for decorators. However, it does not support named registrations. Installers have to be written by hand (the suggestion by Microsoft is an extension class against the service collection).

Autofac

Autofac is an open source DI container, that integrates well with net core. It provides almost the same features as Castle Windsor, and is well documented. It has native support for net core, and it integrates seamlessly with the native container. Modules are the replacement for Windsor installers. It has assembly scanning and you can register named instances. It has better performance than Castle.  With this in mind, I went with this container because how easily it was to integrate into the project.

Lamar

Lamar is Structuremap for net core. I did not review this container. 

Simple Injector

Simple Injector was not reviewed.

Related content

Combining Bulk Load Assemblies and Classes
Combining Bulk Load Assemblies and Classes
More like this
EdFi.Ods.WebApi.Netcore
EdFi.Ods.WebApi.Netcore
More like this
Ed-Fi in Containers
More like this
Conversion to .NET Core 3.1
Conversion to .NET Core 3.1
More like this
Docker Support for Ed-Fi Technology
Docker Support for Ed-Fi Technology
More like this
Miscellaneous
More like this