Tired of looking for errors in log files? Use OneTrueError - Automated exception management in .NET.

Monthly Archives: July 2011

Single Responsibility Prinicple

SRP is one of the easiest principles to learn, but one of the hardest to master. The reason to this is that it can be quite hard to see if a method or class breaks SRP or not. I got … Continue reading

Posted in Architecture, CodeProject | Tagged , , | 7 Comments

A less evil singleton

I’ve been working a bit more with my Griffin Framework and I’m almost ready to release the Specification library in it. The specification library is an abstraction layer similar to CommonLog and CommonServiceLocator although it contains alternatives to both of … Continue reading

Posted in Architecture, CodeProject | Tagged , , | Leave a comment

Reintroducing my compiler class.

I created a class a couple of years ago which simplifies the CodeCom handling when you want to dynamically create objects in .NET. I got reminded of it when I read a question at stackoverflow.com. The class can be used … Continue reading

Posted in CodeProject | Tagged , | Leave a comment

Three reasons to why you should use view models

I’m answered a couple of questions at stackoverflow regarding the benefit of view models. Here is a summary of all my answers focusing on view models in ASP.NET MVC. Reason 1: Remove logic from your views. When you start working … Continue reading

Posted in Architecture, CodeProject | Tagged | 1 Comment

Generic type restriction for enums

I was looking for a way to restrict a generic type identifier to only allow enums. Since you are not allowed to use where T : Enum I checked the metadata for Enum and found that it implements ValueType, IComparable, … Continue reading

Posted in CodeProject, extensionmethods | Leave a comment

Render a view to a string variable

It’s sometimes useful to render a view or a partial to a string variable instead of returning an ActionResult. the following code does just that, add it to your base controller.

Posted in CodeProject | Tagged | Leave a comment

How to create documentation using code comments.

Use the regular XmlDoc tags to document your code, it’s usually enough to type /// in Visual studio to get the default tags. Then use SandCastle to generate documentation. It can create regular help files, but also web based help. … Continue reading

Posted in CodeProject | Tagged , | Leave a comment

jquery ui autocomplete: Uncaught TypeError: Cannot read property ‘element’ of undefined

I got that exception when I loaded some options through JSON (with ASP.NET MVC). It took a lot of digging before I finally found what the cause was. And it’s not what I expected: I’ve made a custom menu plugin … Continue reading

Posted in Uncategorized | Tagged , | Leave a comment