Getting Instance by Type Name in StructureMap

Ever since we are using StructureMap we are also using this as a cheap replacement for Managed Extensibility Framework (MEF), as it allows us to scan arbitrary assembly paths for additional types to inject. As we are also dealing with configuration sections where we specify which plugins or types we want to use in a […]

[NoBrainer] Strongly typed caching with System.Runtime.Caching.MemoryCache

Caching with C# has become easy since the MemoryCache component is included in the .NET framework. While this implementation provides only limited functionality it is actually quite easy to make it strongly typed and support for constructing unique cache keys per cache group. In this post I will show you how this can be done […]

Using Dependency Injection with StructureMap to decouple business logic from WebApi OData Controllers

Today’s post title is rather lengthly so I keep the introduction short and come right to the point: when using OData (or any web services therefore) it can become quite hard to keep the actual business logic separate and not to mix things where they do not belong. At least for me, as I have […]

Replacing MEF with StructureMap

The title of today’s post might sound a little bit provoking, as originally MEF and StructureMap are not meant for the same use cases. However, as there is a great deal of overlapping functionality in StructureMap over MEF (and chances are high one is using an IoC framework anyway), it makes sense to check if […]