How to add SignalR to the telephone directory sample application

15 March, 2014.

As part of a recent mini series we created a very simple telephone directory web page that showed some features of Bootstrap, KnockoutJS, jQuery, Web API and the Entity Framework. Just for fun, I figured it would be cool to add SignalR so that we could see how simple it is to add full duplex, real time communications to your website.The first parts of the mini series can be found here;/.net/create-a-telephone-directory-with-bootstrap-knockoutjs-jquery-web-api-and-entity-framework-part-1-of-…

Continue reading

Create a telephone directory with Bootstrap, KnockoutJS, jQuery, Web API and Entity Framework (Part 2 of 2)

12 March, 2014.

I find that the best way to learn any new technology, or technology that are unfamiliar with, is to sit down and practice. The purpose of this very simple tutorial is to learn the basics of creating a single page website that can be used to capture peoples names and telephone numbers. By following this tutorial you will learn;How to use Bootstrap to create a simple UIHow to use KnockoutJS for binding to/displaying of your dataHow to use jQuery to asynchronously retrieve data from a web…

Continue reading

Create a telephone directory with Bootstrap, KnockoutJS, jQuery, Web API and Entity Framework (Part 1 of 2)

08 March, 2014.

I find that the best way to learn any new technology, or technology that are unfamiliar with, is to sit down and practice. The purpose of this very simple tutorial is to learn the basics of creating a single page website that can be used to capture peoples names and telephone numbers. By following this tutorial you will learn;How to use Bootstrap to create a simple UIHow to use KnockoutJS for binding to/displaying of your dataHow to use jQuery to asynchronously retrieve data from a web…

Continue reading

How to connect to a SQL Azure database using SQL Server Management Studio

01 March, 2014.

If you are writing a website that will be deployed to Windows Azure, or indeed you are using SQL Azure as the backend for some other endeavour, chances are you will want to connect to that database with a management tool and query its data. You can achieve this in one of two ways; using Visual Studio or using SQL Server Management Studio. Using Visual Studio is fine, but I have been using SQL Server Management Studio for many years and I have grown accustomed to it, so it is my preferred tool…

Continue reading

Quick look - Add indexes to tables with Entity Framework 6.1 Beta 1

26 February, 2014.

At the time of writing, beta 1 of Entity Framework 6.1 has recently been released. This is mostly a maintenance release, however, there are several new feature of note, including the ability to add indexes using a new data annotation when developing using the code first approach.Add indexes using the Index attributeTo add an index, simply add the Index attribute as required;A quick look in SQL Server Management studio reveals that the index has been added for us.The key created was non-unique…

Continue reading

Create custom C# attributes

22 February, 2014.

You have probably added various attributes to your ASP .NET MVC applications, desktop applications, or basically any software you have developed using C# recently. Attributes allow you to provide meta data to the consuming code, but have you ever created and consumed your own attributes? This very quick tutorial shows how to create your own attribute, apply it to your classes, and then read out its value.Sample ProjectTo demonstrate this concept, I have created a Console application and added a…

Continue reading

Use T4 Templates to create enumerations from your database lookup tables

15 February, 2014.

T4 (Text Template Transformation Toolkit) has been around for a while now… its been a part of Visual Studio since the 2005 release. In case you don’t know, T4 can be used to automatically generate files based on templates. You create a text template, which is then transformed (interpreted) by Visual Studio into a working file. T4 can be used to create C# code files, and indeed it forms the basis of the current scaffolding templates you have probably used when creating ASP .NET web applications…

Continue reading

Publish your website to an IIS staging environment using Microsoft Web Deploy

08 February, 2014.

One of the simplest and quickest ways to publish your website to a staging environment is, at least in my opinion, using Microsoft Web Deploy. This post is about how you approach this, a future article will discuss why you probably shouldn’t do this. Key points;The remote server should be running Internet Information Services (IIS) 7.0 or later.You can use the Microsoft Web Platform Installer to install all the extra bits you need to make this work.You need to set appropriate permissions to…

Continue reading

Resilient Connection for Entity Framework 6

05 February, 2014.

Disclaimer: I cannot take a shred of credit for the code you are about to see. I simply went over to the Entity Framework source code repository on CodePlex, copied some code, butchered it, hammered it, and rolled it until it fitted nicely into the slot that was my requirements. Please direct your thanks to the Entity Framework team.I had a requirement whereby I needed a resilient Entity Framework connection, and by that I mean a connection that could retry a certain number of times…

Continue reading