Tomas Jansson

Me, myself and I

Configuring Windows Azure Access Control Service

When implementing an application I think it is nice if you can focus your development solving the problems the application should solve and almost nothing else. Most of the time authentication isn't really part of what your application should solve so if you can let someone else handling that part for you, and it would be really great if it were someone you trust.

Git Cheat Sheet

Everytime I need to figure out something in git I end up googling it, and this happens over and over again. Instead of googling it I decided to start my own git cheat sheet on the blog so where I can store the information and also references to sources.

State or intent? The missing discussion of NoSQL

The NoSQL movement has been going on for quite a while now and that I think is a good thing. I really think that different storage mechanisms are good in different situations and we should be better to take advantage of the possibilities we have today. However, there is one discussion that is not as loud as NoSQL vs. SQL/Relational database, and that is the discussion of what we are storing in our database. I think that in many scenarios where the actual application is a little more complex and when you don't know how the application will evolve you would be better off with an event store and event sourcing.

Parsing json with PowerShell and Json.NET

If you would like to know how to parse a simple json-file in P this is the post for you. I will show you have to use Json.NET in PowerShell to parse a json file that could for example be used in configuration scenarios.

I am back!!!

This is my first real post on my new blog. Everything seems to work and I am happy :).

Linq tip of the day - Aggregate

One thing that I have noticed is that people tend to not be aware of the Aggregate function that exist for linq. If you learn how to use the Aggregate function it will be useful for you in many scenarios.

Automatic creation of repository when using gitolite

The last couple of days I've been playing around with git and setup my own git server using first gitosis and then gitolite. When playing around I created a lot of different test repositories to make sure everything work. To stop repeating myself I created three minor bash functions to make it easier to add repositories in gitocline.

Split column in sql (t-sql)

Ok, first of all you should never be in a situation where you need to split columns in a database if you ask me, that is, if you have done your job well. A sql database consists of tables and tables consists of columns so why join columns together and separate the values with ';'? Enough about that. The problem I got served was that there was such a column, comma separated, in the database and now I was asked to split that column into multiple columns, so how do you do that?

Generic data mapper for DataReader

Isn't it boring to write mappers to map data from a db to objects? Wouldn't it be nice if someone wrote one that is simple to use and works in most cases? I guess so and maybe there are several out there, but I wrote one myself anyway. I know a lot of people think you should use EF, linq to sql, nHibernate or some other ORM... but this is an existing project and I want to improve that as much as I could with the tools at hand without adding new frameworks, I'm just glad we are moving away from DataSets :).

Debugging your Windows Service in Visual Studio

It could be hard to debug your windows services if you play by the book. If you do play by the book you need to install the windows service and then attach a debugger to the process to be able to debug the service, of course you might need to do that in some cases maybe to make sure that the service acts as it should under the account it is running. However, to debug the actual functionality it is always easier to just hit F5 in Visual Studio and start debugging and here is how you do that.

Generic list to DataTable

Working with DataTable is for me really anoying, so I wrote a list extension that can convert a generic list to a datatable enabling me to work more with the typed list.

Disposible WCF client wrapper

This post will guide you through how to implement a disposable WCF client wrapper. The motivation behind the wrapper is the fact that a regular WCF client can throw exception when disposing it.

Creating a NuGet package

A lot of people have started using NuGet nowadays so this old post might not be that useful anymore. However, this is a description in how to create package back in version 1.0 days.

Creating custom unobtrusive file extension validation in ASP.NET MVC 3 and jQuery

Just recently I was given the task to move a part of an ASP.NET WebForm to ASP.NET MVC since we are moving over to ASP.NET MVC. The part that I would move over had a form that contained a file upload controller and there were some custom implemented JavaScript hacks to verify that the file had the right file extension. I thought I could do better using data annotations, unobtrusive jQuery and implement a custom validator that also work on the client side so this post is about writing custom validation on the server and unobtrusive validation for ASP.NET MVC 3 on the client.

Securing your ASP.NET MVC 3 application

The following blog post is most likely well covered on the internet, but I thought I would write about it anyway just so I now where to find it next time I need it. As you probably have figured the topic that will be handled in this post is securing your ASP.NET MVC 3 application. When talking about security there are two things we need to consider; authentication and authorization. This post will handle the authentication part since authorization is specific to your application and most of the time it will be enought just to use the AuthorizeAttribute.