structuremap

Constructor Dependency Injection WebApi Attributes

你说的曾经没有我的故事 提交于 2019-11-26 07:47:32
问题 I have been looking around for a non Parameter injection option for the WebApi attributes. My question is simply whether this is actually possible using Structuremap? I have been googling around but keep coming up with either property injection (which I prefer not to use) or supposed implementations of constructor injection that I have thus far been unable to replicate. My container of choice is Structuremap however any example of this will suffice as I am able to convert it. Anyone ever

Best way to use StructureMap to implement Strategy pattern

二次信任 提交于 2019-11-26 05:36:54
问题 My web app has some slight variations in business logic and presentation logic depending on the type of user that is logged in. It seems like getting variations by injecting different concrete classes based on the user type is a good fit for DI. So I\'m wondering what features of StructureMap I should use to achieve this (or if I\'m way off base on the purposes of DI). (I just learned that Profiles are not the way to accomplish this because setting the Profile isn\'t a per-thread operation: