OJ Develops

Thoughts on software development. .NET | C# | Azure

Separating Business Rules from Data Access

01 March 2015

Business rules can be mixed into data access code. This scenario is a violation of the Single Responsibility Principle, because the data access class would have to change if the business rules change. In this post I will show you how to separate the business rules from the data access code.

Read More

Adding an SQL Azure Linked Server

10 January 2015

When adding an SQL Azure Linked Server through SSMS, you will encounter an error if you go through the normal way (Server Objects > Linked Servers > New Linked Server). That is because the New Linked Server wizard does not allow you to specify the catalog name if the chosen Server Type is SQL Server, which should be chosen when adding an SQL Azure Linked Server. To accomplish this, the stored procedure sp_addlinkedserver should be used.

Read More

Login with AngularJS and ASP.NET Web API

26 December 2014

When creating a non-Web API ASP.NET MVC project using Individual Accounts, the generated template makes use of Forms Authentication. When logging in using Forms Authentication, a cookie is stored on the client's machine and that cookie is included by the browser in each future request.

Read More

Don't Make Me Think... About Your Code

29 November 2014

Don't Make Me Think is the title of the famous UX book by Steve Krug. One of the main ideas in the book is that a user interface should be designed in such a way that users' thinking is kept to a minimum. As much as possible, it should be obvious what actions the user must do to achieve a goal.

Read More

Entity Framework Code First Migrations

27 September 2014

So you've created your entities and had Entity Framework create your database for you. Now, you want to change your entities and of course also change the database schema. How do you go about doing that?

Read More

Using Fiddler to Examine Web Traffic

10 April 2014

When building typical web applications using ASP.NET WebForms and ASP.NET MVC, the usual way of testing and debugging is to see whether the page loaded correctly (ie whether it displays the correct data or not). However, when building ajax applications / single page applications, you want to test not only the appearance of the page but more importantly the results of API calls. Since these results may not be obvious by just looking at the page, we need a different method of testing.

Read More

How to Create a Console Application from Visual Studio Express for Web

01 April 2014

Web application solutions may not always be composed of only web site projects, web services, and class libraries. There are cases when console applications are needed as well. However, the default templates in the web express editions of Visual Studio do not include a console application template. In this post I will provide a workaround for that issue.

Read More

Common AngularJS Directives for Designers

25 February 2014

AngularJS is not only for UI developers, but also for UI designers. In fact, the separation of concerns and readability that AngularJS brings enable smooth collaboration between designers and developers. Here are some common directives that designers will encounter in AngularJS.

Read More