Articles tagged .NET

04 August 2014
04 August 2014

Creating Custom OAuth Middleware for MVC 5

Website visitors will have come to expect to be able to use OAuth authentication, rather than require yet another ID and password. Although MVC5 provides Google, LinkedIn, Facebook or Twitter authentication, you would need to write custom authentication middleware for any other provider. Ed Charbeneau shows you how to get started.… Read more
01 August 2014
01 August 2014

A TDD Journey: 3- Mocks vs. Stubs; Test Frameworks; Assertions; ReSharper Accelerators

Test-Driven Development (TDD) involves the repetition of a very short development cycle that begins with an initially-failing test that defines the required functionality, and ends with producing the minimum amount of code to pass that test, and finally refactoring the new code. Michael Sorens continues his introduction to TDD that is more of a journey in six parts, by implementing the first tests and introducing the topics of Test doubles; Test Runners, Constraints and assertions… Read more
01 August 2014
01 August 2014

A TDD Journey: 5- Tests vs. Code; Refactor Friendliness; Test Parameterization

Test-Driven Development (TDD) has a workflow of writing some test code, and then writing some production code to make the test pass. That is necessary but not sufficient-you must also make sure the test and the code together are doing what you think! Michael Sorens continues his series by introducing Test case parameterization for avoiding code duplication with no additional code complexity. … Read more
31 July 2014
31 July 2014

A TDD Journey: 2- Naming Tests; Mocking Frameworks; Dependency Injection

Test-Driven Development (TDD) relies on the repetition of a very short development cycle Starting from an initially failing automated test that defines the functionality that is required, and then producing the minimum amount of code to pass that test, and finally refactoring the new code. Michael Sorens continues his introduction to TDD that is more of a journey in six parts, by implementing the first tests and introducing the topics of Test Naming, Mocking Frameworks and Dependency Injection… Read more
30 July 2014
30 July 2014

The JavaScript Landscape in Broad Brushstrokes

JavaScript has come a long way from its humble origins as a simple interpreted object-oriented language for browser-side scripting of web pages. It's many inadequacies, poor debugging and testing, and its design weaknesses, have now been circumvented by frameworks and libraries. JavaScript is now ubiquitous, but is it now suitable for a central role in corporate applications?… Read more
28 July 2014
28 July 2014

The .NET 4.5 async/await feature in Promise and Practice

The .NET 4.5 async/await feature provides an opportunity for improving the scalability and performance of applications, particularly where tasks are more effectively done in parallel. The question is: do the scalability gains come at a cost of slowing individual methods? In this article Jon Smith investigates this issue by conducting a side-by-side evaluation of the standard synchronous methods and the new async methods in real applications.… Read more
15 July 2014
15 July 2014

A TDD Journey: 1-Trials and Tribulations

Test-Driven Development (TDD) has a misleading name, because the objective is to design and specify that the system you are developing behaves in the ways that the customer expects, and to prove that it does so for the lifetime of the system. It isn't an intuitive way of coding but by automating the specifications of a system, we end up with tests and documentation as a by-product. Michael Sorens starts an introduction to TDD that is more of a journey in six parts:… Read more
11 July 2014
11 July 2014

Caching: the Good, the Bad and the Hype

One of the more important aspects of the scalability of an ASP.NET site is caching. To do this effectively, one must understand the relative permanence and importance of the data that is presented to the user, and work out which of the four major aspects of caching should be used. There is always a compromise, but in most cases it is an easy compromise to make considering its effects in a heavily-loaded production system… Read more
11 July 2014
11 July 2014

Catching Bad Data in Entity Framework

Any website that rejects the users' input without giving enough information to correct what they're doing is doomed to be unpopular. Entity Framework offers three different ways of validating data before writing it to the database. As well as describing how to harness these validation methods Jon Smith shows how capture these errors to make the feedback to the user less cryptic.… Read more
03 June 2014
03 June 2014

Configuration Management with PowerShell and XML

For the rapid delivery of any software application, there must be an effective configuration management system that is scripted. As the application increases in size it becomes more important that configuration information is kept in one place, without repetition, in version control. How to achieve this in practice? Konrad Lukasik explains a working solution.… Read more
19 May 2014
19 May 2014

Shouldn’t Your ASP.NET MVC Apps Support Localization?

An increasing number of applications are being designed to be configurable by the user to display content in a one of a number of alternative languages, currencies, date formats and other cultural aspects. It is better and easier to make such localization support intrinsic to the design rather than to retro-fit it. So what is the best way of doing so in ASP.NET MVC?… Read more
25 March 2014
25 March 2014

Automate the Complete Windows Environment Setup and Configuration

Boxstarter is an open-source application that enables you to do the unattended install of everything required to turn bare metal, Azure VM or Hyper-V VM into a working Windows Server. It is built on top of Chocolatey, Nuget, and PowerShell to make the repeated installation of windows-based machines into an automated error-free process. Matt Wrock, Boxstarter's creator, explains how to use it.… Read more
21 March 2014
21 March 2014

Social Login in ASP.NET MVC

It isn't every web application where one would want visitors to identify themselves via their Twitter, Facebook, Google or LinkedIn account. However, where it is essential to allow comments or other social interaction on your site, then ASP.NET MVC makes a 'social login' like this remarkably simple to do.… Read more
25 February 2014
25 February 2014

Mixing Web Forms and ASP.NET MVC

Just because you're using Web Forms, it doesn't mean that you are stuck in a technical time-warp. If you want to liven up a site with new features using Ajax and libraries such as jQuery, Bootstrap or Knockout.JS, then you can always integrate a Web API layer into a Web Forms application. Dino Esposito shows how to give your Web Forms application a new lease of life.… Read more
06 February 2014
06 February 2014

Acceptance Testing with FitNesse: Multiplicities and Comparisons

FitNesse is one of the most popular tools for unit testing since it is designed with a Wiki-style interface that makes it very easy to set up individual tests. Michael Sorens' sixth article in his series delves into the nuances of multiple inputs vs. multiple outputs, multiple rows vs. multiple columns, as well as things that can trip you up when attempting to validate a value.… Read more
03 February 2014
03 February 2014

OWIN: Customizing the Web Server

OWIN and Katana are designed to provide a different way of meeting those objectives that currently require the use of NodeJS. With them, you can run extremely thin and super-optimized web server applications by cutting out what you don't need and swapping out those parts that you wish to behave differently. Dino Esposito explains how to get started.… Read more