Skip to main content


Showing posts from 2015

ASP.Net 5 and C# 6: Slides and Resources

ASP.Net 5 and C# 6: Slides and Resources Had the pleasure of speaking yesterday at the London Umbraco meet-up hosted at Zone on the topic of ASP.Net 5 and C# 6. For anyone who was there and wants a reference, or who wasn't and is interested in an introduction to this area, I'll post a few resources. Firstly the slides from the talk are available here . And then here's a number of links to blogs and other online resources that I've used in researching the topic and preparing the talk: Intro to ASP.Net 5 from Scott Gu Video introduction from Scott Hanselman and Scott Hunter Source code repository ASP.Net 5 documentation ASP.NET 5 Middleware, Or Where Has My HttpModule Gone? Understanding ASP.NET 5 middleware Taking Control of Configuration in MVC6 Introduction to view components Introduction to tag helpers Creating a custom tag helper C# FAQs - New Features in C# 6 New Language Features in C# 6 MSDN magazine: The New and Improved C# 6.0 You can e

DDD, CQRS and testing with ASP.Net MVC: Slides and References

Just had the pleasure of attending and speaking at the Web European Conference in Milan. For anyone that attended my talk, or any that didn't but were tempted more by another session, here's some links to slides and references. Slides can be found here at And here's a few links to blog posts I've written before on the subject: CQRS, Rich Domains and Unit Testing with ASP.Net MVC and Entity Framework A CQRS Implementation with ASP.Net MVC and Entity Framework Rich Domain Models and Entity Framework Unit Testing Entity Framework with Effort A few references to sources I used in researching and constructing the presentation: Rob Conery's post on working with Entity Framework and repositories got me thinking about how best to work with the ORM in my application. Jimmy Bogard's series of posts on cleaning up your controllers led me to a version of the mediator/CQRS pattern he outlines. Adam Tibi provided a direct implementation o

Code As Data With Reflection

Other than occasional use, working with reflection using C# isn't something I've had that much need to do. Recently though I was working on an additional feature for the Umbraco package The Dashboard . It provides a nice first screen for editors, showing their recent edits and other work carried out on the site content. The idea for the new feature was to create a developer version of this, that displayed various details about the code that had been implemented on the project. The use case being in the case of inheriting or coming back to a site, being able to have a quick overview of the techniques that have been used for route hijacking, surface controllers, application events and the like. In order to implement this it was going to be necessary to make quite heavy use of reflection and this post highlights a few of the methods used. Getting instances of types In the case of Umbraco route hijacking using custom controllers it's necessary to implement an MVC con

(Yet) Another Look at Unit Testing Umbraco Surface Controllers

A quick recap A little while back now I spent a bit of time investigating how one might go about unit testing Umbraco surface controllers . With the help of information posted by some others that had similarly looked into it I found there was a method that worked, but it wasn't ideal for a number of reasons. Firstly there was a need to utilise an Umbraco test helpers dll , that contained implementations of various base classes that could be used to support testing. No great hardship to use that but it did mean you had to compile the source to get it and it led to some other restrictions on your tests. One of those being you had to use NUnit . Again, a perfectly decent test runner but if you generally used MSTest or something else you had to make a switch. And lastly in order to create various surface controller dependencies, you had to use some rather impenetrable looking reflection code to get around the fact that certain classes and methods were marked as internal rat

2015 British General Election - Progressive Alliance What If?

Rather off topic for me on this blog but thought interesting nonetheless to publish... I was taken following the personally rather disappointing UK election results by a comment by the Green MP Caroline Lucas reported in the Guardian . Reflecting on the result, she is quoted as saying... The system is wrong and we should have electoral reform, but that could be some time coming. So we need other ways to work together in a progressive alliance. Where it is appropriate, only one progressive candidate could stand in a seat – a sort of electoral pact... Which got me interested in the numbers, in particular considering what the change in the result might have been if such a pact was in place for 2015. Clearly there's a lot of assumption in this - not least the fact that I'm using the hindsight of the actual results to determine what might have been different, which is rather circular. It also assumes that every voter that would have voted say Liberal Democrat would be happy

Sample Site for Merchello with Umbraco

For a while now, since last Codegarden in 2014 in fact, I've been planning to take a look at Merchello , an e-commerce framework for Umbraco . In the past I've made use of uCommerce which worked well for the project but the fact that, like Umbraco, Merchello is open-source is one factor that makes it attractive to consider for future projects. So on and off for the past few weeks I've built out a very basic store site. Really doesn't look like much and has little in the way of bells and whistles, but implements a number of the core features required for an e-commerce website, namely: Product category and product pages Products with variants, with price and availability indicated for the particular variant selected Basket page with quantity update and option to remove Billing and shipping detail collection Delivery method selection and application of postage & packing costs Selection of payment method Integration with a credit card processing provider, A