Apr 302012

Here is the problem: How to properly display a user-friendly error message for an exception being thrown from an ASP.NET Web Service? I know that we shouldn’t be really working anymore with ASP.NET Web Services as a huge amount of problems have been solved with the WCF framework. But, for those like me, that are working on some large-scale projects where we are still using [… read more]

The anatomy of a Unit Test

 Posted by on April 30, 2012
Apr 302012

Certainly there are many ways of organizing Unit Tests and it depends both by who writes the tests and the organization within which the project is running, but one thing is certain the goals of unit testing as: 1. Finding Code early: As in Test Driven Development when writing Unit Tests before writing the real code. Doing so we are certain that our use case [… read more]

Apr 272012

This is my first post about the code refactoring, and I hope that in the future there will be many, as I find this topic particularly important and interesting. I would like to start with one very simple method but perhaps not so often used in the real life programming: Composed Method pattern. One way of refactoring the code, or in our case a method, [… read more]

Composition over Inheritance

 Posted by on April 25, 2012
Apr 252012

One (clever) question from my colleague during one interview we had days ago was about why is composition preferable over inheritance. On the other side we had a very clever guy as well:) so the answer was pretty much convincing, but at the same time this made me thinking a bit about all of the possible implications and the differences between the two. In my [… read more]

Apr 222012

By starting this post, I am still not quite sure what will be the end result, as the topic is quite waste and not that easy. For sure the goal is not to give you every possible example of multithreading in Microsoft.NET, as this is quite difficult and extensive topic, but to list and make you aware of different possibilities we have in Microsoft.NET when [… read more]

Apr 202012

In the previous post I described a way of how to apply global filters in the DbContext, so I would like to follow up with adding some more functionality and to describe one way of how to create a generic querying and sorting mechanism. This comes really handy when using the repository pattern. Please consider downloading a fully working example of the code covered in [… read more]

Apr 142012

I am currently writing a prototype for an application so I thought it would be good to start using a different ORM than NHibernate and the Entity Framework Code First was the next “obvious choice”. Code First is particularly interesting because it allows using POCO object, which fits perfectly with my programming style, as I try to follow as much as possible Domain Driven Development [… read more]