DevTrends Blog
The DevTrends technical blog covers .NET, Microsoft Azure, IoC, ASP.NET MVC, Web API, AspNet Core, Open Source releases plus anything else that I find interesting :-)
Displaying page 3 of 4
Azure Web Sites Git Deploy For Multiple Project Solutions
If you are trying to Git deploy a solution with multiple web projects to multiple Windows Azure websites, you will find that it does not work out of the box. This post describes a simple way to workaround this omission by creating a custom deployment script. Don't worry though - it is dead simple. More »
Introducing the Unity.WebAPI NuGet Package
Whilst the IDependencyResolver interface in the new ASP.NET Web API is identical to its in ASP.NET MVC 3+ compatriot, it is nevertheless in a different namespace and assembly and thus, effectively a different interface. Unity.WebAPI brings the functionality of the popular Unity.Mvc3 package to WebAPI, allowing you to inject dependencies into your ApiControllers via Unity and have IDisposable components automatically disposed of at the end of the request. More »
Introducing Unity.WCF - providing easy IoC integration for your WCF services
There are numerous blog posts available that explain how to hook up Unity with WCF. Unfortunately, many of these are incomplete, too basic or just plain wrong. Additionally, as far as I can tell, nobody has created a NuGet package to get you up and running as quickly as possible. This post introduces Unity.WCF, an open source NuGet package that (hopefully) just works in most situations, deals with cleaning up IDisposable instances and also provides a nice mechanism for automatically adding WCF behaviors to your services. More »
Using Unity's automatic factories to lazy load expensive dependencies
Automatic factory support in Microsoft's Unity IoC container is not something new, having been introduced with Unity 2.0 back in 2010. Unfortunately, not many people seem to know about it and the blog post that I used to find out about it is no longer available. This short post explains how to use automatic factories and why they can be useful. More »
What's New In MvcDonutCaching 1.1?
A new version of MvcDonutCaching has just been released with even more features plus several bug fixes. Following user feedback, this release centres on allowing MvcDonutCaching to be used in place of the built-in OutputCache attribute in many common scenarios. This should mean that you can take advantage of the many MvcDonutCaching benefits without losing core OutputCache functionality. V1.1 adds support for non-view action results and cache location specification and also fixes several known bugs. More »
Validating WCF service operations using System.ComponentModel.DataAnnotations
All WCF services operations need some level of parameter validation to ensure that the data passed to the operation is present and correct. Two popular methods are manual checking and the Validation Application Block (VAB) from Enterprise Library. This article discusses another option - using the validation features from System.ComponentModel.DataAnnotations. More »
ASP.NET MVC Output Caching with Windows AppFabric Cache
Enterprise level web applications are typically hosted in web farms where in-process caching is less useful than a distributed caching approach such as Windows Server AppFabric or Memcached. Thanks to the extensibility features introduced with ASP.NET 4.0, modifying an application to use a distributed cache is a very simple process. This post explains how to create an AppFabric OutputCacheProvider and how to configure ASP.NET to use the new provider. We will also discuss a big limitation with the MVC3 OutputCacheAttribute and explain how this is addressed by the MvcDonutCaching NuGet package. More »
Donut Output Caching in ASP.NET MVC 3
Donut caching is the one form of output caching that is conspicuously absent from ASP.NET MVC 3 (and MVC4 as we speak) and is greatly missed by many developers. This post describes MvcDonutCaching, a new open-source NuGet package that adds donut caching to MVC3 in a simple and performant manner. More »
How not to do dependency injection - using XML over fluent configuration
Virtually all the developers that I come across who do not like using IoC containers have been put off by verbose, error prone XML-based configuration. Many people do not even realise that a type-safe alternative is available in all the popular IoC containers. If you are struggling with XML config, fluent configuration could be the answer to your prayers. More »
How not to do dependency injection - configuring the IoC container in unit test projects
You will often hear people say that using IoC allows your code to be unit testable, and they are of course correct. If you are doing dependency injection correctly, you code will inherently be unit testable. The subtlety that needs to be understood is how DI aids unit testing. It is certainly not the use of an IOC container which should have absolutely no bearing on your unit testing code. More »
How not to do dependency injection - the static or singleton container
Dependency injection and the use of IoC containers is becoming more and more popular but many development teams do not have the knowledge or experience necessary to fully utilise the power of the IoC container. In the next few posts, we will take a look at the most common mistakes and how to address them. In this post, we are going to talk about the static or singleton container and why this 'pattern' is such a bad idea. More »
Integrating The Unity.Mvc3 1.1 NuGet Package From Scratch
A new version of Unity.Mvc3 has been published that targets the recently released Unity 2.1. It is available as a NuGet Package (Unity.Mvc3) downloadable from within Visual Studio. You can also download the dll and the source code from codeplex. This article explains the changes in this release and goes on to explain how to do dependency injection in an MVC application using Unity.Mvc3. More »