A typical architecture of a .NET web application is to use EF Code First for data access and MVC to render the web pages. The data model in the database is usually (and should be!) normalized. A normalized data model is also great for updates, but when displaying data it is not enough. E.g. in… Continue reading Separating the Read Model
Category: C#
19th Century Theorem Simplifies Conditions
Old knowledge can become valuable in a new context. The 19th century De Morgan’s Laws is a splendid example of that. Belonging to the theoretical propositional logic I doubt it had any significant applications back then. Nowadays within programming it can really help. The law is about equivalence for logical constructs. The laws can be… Continue reading 19th Century Theorem Simplifies Conditions
Built in .NET CSV Parser
In administrative systems, there is often a need to import and parse csv files. .NET actually has a built in CSV parser, although it is well hidden in a VB.NET namespace. If I had known about it I wouldn’t have had to write all those custom (sometimes buggy) parsers. To really test the parser, I’m… Continue reading Built in .NET CSV Parser
Don’t use Linq’s Join. Navigate!
One of the greatest benefits of LINQ to SQL and LINQ to Entities is navigation properties that allows queries across several tables, without the need to use explicit joins. Unfortunately LINQ queries are often written as a direct translation of a SQL query, without taking advantage of the richer features offered by LINQ to SQL… Continue reading Don’t use Linq’s Join. Navigate!
Bitten by yield return
I like the simplicity of creating enumerations with iterator blocks through yield return. Even though I regularly do it, I was bitten by a nasty bug a few weeks ago and it was entirely my own fault. I had been working hard on my bar management system, which includes a service to book a bar… Continue reading Bitten by yield return