Posts

Using NLog to Log to a Database with Entity Framework Code First

Image
NLog is a logging framework that is used to add logging capabilities to a .NET application. Today I am going to show how to use NLog to generate logs on a database created by Entity Framework Code First.

Adding an SQL Azure Linked Server

Image
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.

Login with AngularJS and ASP.NET Web API

Image
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.

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

Image
"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. Answers to questions like "where do I go to checkout?" or "what will happen when I click this button?" should be obvious just from looking at the page.

Entity Framework Code First Migrations

Image
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?

Using Fiddler to Examine Web Traffic

Image
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.

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

Image
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.