Category Unity

SignalR Messaging A more complete server with a Console Application

This post continues on from: SignalR Messaging with console server and client, web client, WPF client Now the server will be developed with some error handling, proper logging, an IoC and an Client assembly with an interface and DTOs. Code: https://github.com/damienbod/SignalRMessagingErrorHandling.git To make it easier to use in a .NET client project, we can create […]

Using SignalR with Unity

This post demonstrates how to use Unity as an IoC for SignalR. To inject into SignalR, the Microsoft.AspNet.SignalR.Hubs.IHubActivator class should be used. Code: https://github.com/damienbod/SignalRHostWithUnity Step 1: Use NuGet to add Unity and SignalR and also SignalR Self Host Step 2: Create an UnityHubActivator class. This class implements the IHubActivator interface. The Unity container is used […]

Slab Logging with an IoC Container

Slab Logging or Semantic Logging is part of the Microsoft Enterprise Library 6. In this post, a wrapper framework will be used to log and use EventSource classes. The EventSource can then be used with an IoC container without requiring static constructors. We don’t want to create a wrapper class for each EventSource. Static methods […]

Windows Service with Self Hosted Wep Api 2

This is a simple example of a windows backend service which hosts a Web Api 2 service. The application is deployed using WiX. The application can then be used as a backend for a simple game with different UIs, for example an android App, MVC 5 web application, or an WPF UI application. The application […]

Self Hosted Web Api using Owin and Unity, Nuget Package Documentation

This is the documentation for the nuget package Unity.SelfHostWebApiOwin. The package is dependent on Katana 2. The code can be found here: Example, how to use: https://github.com/damienbod/HelloWorldUnityWithSelfHostedOwin Source code: https://github.com/damienbod/SelfHostWebApiWithOwinAndUnityUsingNuget How to create an application using the nuget package: Step 1: Create a Console application. This will be used to start the application or could […]

SelfHost WebApi with Owin and unity using a Nuget package

This post continues in from the previous blog Self Host WebApi with Owin and Unity The blog project and nuget package can be downloaded from here: nuget: https://www.nuget.org/packages/Unity.SelfHostWebApiOwin code: https://github.com/damienbod/SelfHostWebApiWithOwinAndUnityUsingNuget In this blog, a nuget packet will be created, so unity can be used with a self hosted web Api easily. What is required in […]

Self Host WebApi with Owin and Unity

Using Unity together with a WebApi application and OWIN Hosting is a little bit more complicated compared to the standard WebApi and Unity. This blog shows how to host ASP.NET Web API in a console application, using OWIN to self-host the Web API framework and Unity as an IoC. The following steps need to be […]