Disposable Base Class

I have covered the IDisposable interface in my previous posts IDisposable and using in C# and Implementing IDisposable. To make the implementation of IDisposable easier, I have written an abstract base class that handles the details of the IDisposable pattern. The objectives of the class is to: Provide a simple, reusable implementation of the disposable pattern. Pass all… Continue reading Disposable Base Class

Code Generation – Blessing or Curse?

There are lot of code generation tools available. Microsoft Visual Studio has had code generation possibilities since I started using it in the mid 90-ties. Code generation can be a blessing for getting something up and running quickly, but also a curse when maintaining code. Whenever a code generation tool is considered, there are two… Continue reading Code Generation – Blessing or Curse?

Data Binding a Single Object when IEnumerable is Expected

Controls that can be used with data binding typically expect some kind of collection as the data source. One example is the ASP.NET DetailsView control. It displays a single record, but still expects a collection (to be exact: something that implements IEnumerable) to be assigned to its DataSource property. I use a small extension method… Continue reading Data Binding a Single Object when IEnumerable is Expected