Node.js with Express – Getting form data
Now that view engines are wired up and working on this application, the next area to look at is getting data back from the browser. By default Express doesn’t do anything with form data in the request...
View ArticleNode.js with Express – Come to the dark side. We have cookies!
So far, so good. At the point the application displays a list of languages and will display the language that the user picked. However, for the flashcards to work, that selection will have to be...
View ArticleDeploying a Node.js with Express application on Azure
By the end of the last post, there was enough of an application to deploy it, so let’s deploy it. Prerequisites An FTP client to get at the files on Azure. A GitHub account (or other source control,...
View ArticlePreviewing Config Transforms
Curiously, I didn’t know about this until recently and it is such a useful thing too. You can preview the results of your configuration transformation from within Visual Studio. First of all, right...
View ArticleCode Review: Making a drop down list out of an enum
I’ve come across code like this a couple of times and it is rather odd: IEnumerable<CalendarViewEnum> _calendarViewEnums = Enum.GetValues(typeof(CalendarViewEnum)).Cast<CalendarViewEnum>();...
View ArticleSetting up Code Coverage in Team City
The project that I’m working on has a rather spotted history for unit tests until now. There would be periods of people actually writing them, but then come unstuck when a random test failed and...
View ArticleThe difference between & and && operators
Here is a bit of code that was failing: if (product!=null & !string.IsNullOrEmpty(product.ProductNotes)) If you look closely you can see it uses just the single ampersand operator, not the usual...
View ArticleChanging the default Assembly/Namespace on an MVC appliction
TL;DR When getting an error message like this: Compiler Error Message: CS0246: The type or namespace name 'UI' could not be found (are you missing a using directive or an assembly reference?) when...
View ArticleCustom routing to support multi-tenancy applications
The company I currently work for has many brands so they are looking for a website that can be restyled for each brand. They also want the styling information to be managed through an admin area rather...
View ArticleTwo Factor Authentication with GitHub and Visual Studio 2013
New job, new tools, new processes. In my new job we’re using GitHub for source control, and because the data is sensitive we’re also using two factor authentication. Because I develop with Visual...
View ArticleDebugging a process that cannot be invoked through Visual Studio.
Sometimes it is rather difficult to debug through Visual Studio directly even although the project is right there in front of you. In my case I have an assembly that is invoked from a wrapper that is...
View ArticleUsing GitHub Two Factor Authentication (2FA) with TeamCity
If you have two factor authentication (2FA) set up in GitHub and you also want to use TeamCity, the easiest way to set this up is to set up SSH keys to access the GitHub repository. The first step is...
View ArticleSetting up Ubuntu for .NET Development
First up, at the time of writing only Ubuntu 14.04LTS is supported. I’ve read that it will work on 15.04, but I know it won’t work on 15.10 because of a binary incompatibility on a library that .net...
View ArticleApplication configuration in .NET Core – Part 1
.NET Core has a new way of working with configuration that is much more flexible than the way that previous versions of .NET have. It allows you to: Pull configuration from multiple sources and bring...
View ArticleApplication Configuration in .NET Core – Part 2
In the first part we got started by pulling in configuration data from multiple source in .NET Core, in this part we’ll look at mapping the configuration onto a set of classes so that is becomes easier...
View ArticleOverusing the Null-Conditional Operator
The null-conditional operator is the the ?. between object and field/property/method. It simply says that if the thing on the left hand side is null then the thing on the right hand side is not...
View ArticleBut why is the iterator operating in multiple-threads
Background Recently, I had a bit of a problem with NHibernate when I was converting some code into parallel tasks. (If you have no interest in NHibernate, then don’t worry – it is just background to...
View ArticleAggregate of columns, not rows
In SQL Server it is very easy to aggregate a value across many rows. You simply just write something like this: SELECT MAX(SomeColumn) FROM SomeTable This will return one row with the aggregate value...
View ArticleJoin Null Check with Assignment
I recently wrote some code and asked ReSharper to add a null check for me, which it did. Then it suggested that I could simplify the null check by joining it to the assignment. Intrigued, I let it....
View ArticleParamore Brighter: Using .NET Core’s Dependency Injection
This is the first in a series of posts on Paramore.Brighter. I’m writing this as a series of recipes, with the aim of you picking up a point quickly and getting going with it. The code for this post is...
View Article