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
Category: C#
Data Binding a Single Object when IEnumerable
Always Check Generated SQL
In my last post I advocated for using LINQ to SQL for data access. Today I am going to show an example of how the greater power of LINQ compared to SQL sometimes results in terrible performance when LINQ to SQL does it best to work around the limitations of SQL. var q = from… Continue reading Always Check Generated SQL
Design Patterns in the Wild
Design patterns are often presented as standard solutions that can be used to commonly occurring problems. I think that it is equally important to be able to recognize patterns in existing code. Being able to identify a pattern helps understanding the code better. It also helps rising the abstraction level. It can be used to… Continue reading Design Patterns in the Wild