Saturday, July 28, 2012

Pass NULL to the Contains Method in C#

I wanted to use FirstOrDefault method inside of the Contains method for List<T>. FirstOrDefault(...) method returns the first appearance of the element (defined by the expression in the brackets) or the default element. Default element is the result of default(SomeClass) and is NULL for all user-defined classes. Thus, my concerns was what would happen if I will pass NULL to the Contains method. It happens that Contains just returns FALSE wherever it has NULL as an input parameter. It does not depend on whether are any elements in the collection.

Sunday, July 22, 2012

Wrath of the Titans

Why can't they make a good movie based on the Greek mythology? As I recall Troy with Brad Pitt was the only one worth noting. The only thing Wrath of the Titans has is effects. They are really good. No credit for good characters in the plot ad they are all were created long long ago. They tried to merge several myths and obviously failed. Worst of all, the movie is totally meaningless. I don't get why they fight, for what and who are they. Why not just follow the myth then? They have a lot of sense.