MassTransit IoC implementation with SimpleInjector - asp.net-web-api2

I have to use MassTransit on my WebApi project, but I can't find any sample of how to implement it with Simple Injector on a WebApi 2 (OWIN) application.
Any help will be appreciated.

Related

Service Fabric WcfCommunicationListener With IServiceCollection (IOC). .Net core 1

I've been searching for an example using WcfCommunicationListener and IServiceCollection, in the same way that a stateless service Listener makes a call to ConfigureServices so as to setup the Container.
I'm stuck with .Net Core 1 for this
Anyone any ideas?
Thanks in advance

MVC 4 web api that consumes WCF Services

I would like to know if any of you knows how to consume wcf services from MVC 4 web API.
I know it might sound crazy but I have to have them both in the same solution, that's why I need to know if anyone here can provide me with some tutorial or some more detailed explanation.
Thanks in advance.
generate your proxy class using your wcf service contract
call the proxy class from your web api to access the wcf service.
or make use of Castle Windsor WCF facility and let it create the client on the fly for you.
http://docs.castleproject.org/Default.aspx?Page=WCF-Integration-Facility&NS=Windsor&AspxAutoDetectCookieSupport=1

Selecting an IoC container for asp.net webapi

I am looking for an ioc container to use for asp.net webapi. Couple of the key feature we are looking for are as follow
Custom lifetimes
Built-in support for web request lifetime
Good integration with web api in terms of manage the dependency registration.
Mark Seemann knows his DI/Ioc and has an article on implementing it for Wep Api with Castle Windsor here. I don't know about custom lifetimes but it definitely solves the second and third requirements.
Castle is not as lightweight as say Autofac but it's been around for years and is tried and tested: I am using Castle for my Web Api and Mvc projects without issue so far.
Both should do the job though.
I personally like Unity. The reason why I use Unity is that it is build by Microsoft and with that you can expect that it is nearly up-to-date. Also I had prior experience with it and it has good support for ASP.NET Web API, but the final choice for or against a container is up to you. It really dependent on personal flavor.
There's a small part in the ASP.NET tutorials which talks about using Unity with Web API.

Resolving dependencies in ServiceRoute with Unity on an ASP.NET MVC project

I have a WCF service that I expose via REST using ServiceRoute in an ASP.NET MVC project:
routes.Add(new ServiceRoute("Rest", new WebServiceHostFactory(), typeof(ServeiInventaris)));
In my controllers, I use Unity to resolve dependencies. Is there a way to integrate Unity with ServiceRoute to let it resolve my dependencies (the dependencies of the REST service)?
Yes, you can. The solution is custom service host factory. Here is descibed complete solution. Neovolve blog We are using it successfully for one year.

DI with WCF -- Where do I initialize the Windsor Container when using WAS hosting?

I was reading an exellent article about how to use dependency injection with WCF Services.
Unfortunately, it only shows how to instantiate and register the Windsor Container in a global.asax file. I'm looking to use WAS for my hosting so global.asax will not get called. Does anyone know where I should register the container? Do I have to extend the WindsorServiceHostFactory an do it in there?
I'm not 100% up to date with development of WCF Facility so it may be already there, but if it's not take a look at this post and the comments.