Yesterday, I posted a poll asking for peoples opinions on the use of the var keyword with non anonymous types.At the time of writing, the "No! It’s just for anonymous types" have the vote with 51% against 44% - and 5% not really caring (although the vote might have been slightly skewed by some of my friends campaigning:).I just found a post by Dare Obasanjo from earlier this year with the same title: C# 3.0 Implicit Type Declarations: To var or not to var.In it, he sites several references on the matter including two posts by a member of the Resharper team called ReSharper vs C# 3.0 - Implicitly Typed Locals and Varification -- Using Implicitly Typed Locals and, perhaps most compelling, the C# Reference which states:
Overuse of var can make source code less readable for others. It is recommended to use var only when it is necessary, that is, when the variable will be used to store an anonymous type or a collection of anonymous types.
This close...
Content suppressed by ://URLFAN, for full article visit source
Databinding and Nullable types in WinForms.NETSource:
http://www.thejoyofcode.com/Databinding_and_Nullab...Post Date: 2006-05-10 14:50:17
Scenario
You have an Entity Type with a Nullable property.
You have a TextBox which is bound to that property.
When the user clears the text in the TextBox, you want the value of your property to be set to null.
Problem
The result of the databinding will simply not succeed when clearing a TextBox which is bound to a Nullable type.
Solution
In this article I am going to show how you can do this by using an Extender Provider.Simply add a Component class to your pro...
Article mentioned at lhotka.netSource:
http://www.thejoyofcode.com/Article_mentioned_at_l...Post Date: 2006-05-13 03:42:29
I was at the Patterns & Practices summit in Oslo last week, and during a conversation with Rockford Lhotka and one of my colleagues we discussed some ideas to get around the problem with databinding and nullable types.
Rocky gave me some pointers in the right direction and was also kind enough to link to the article from his own blog. Thanks a lot Rocky!
...