Well – “as” is faster to type than a “real” cast using two brackets and has the same result. Really?
C# provides several ways to cast one type to another one. The two used in most cases are the “([Targettype]) [Variable]” and the “[Variable] as [Targettype]” notations. Many developers see them as equivalents, some even prefer “as” because it does not throw an exception when the cast fails.
Example
Let’s say we have a variable called obj of type Object and we want to cast it to an IFoo so we can call IFoo.Bar:
object obj; //... (obj as IFoo).Bar();

Distinguish between overloaded methods in XML-Comments
July 28, 2009 — winsharp93XML-Comments are quite handy when documenting public methods / classes. But what about method overloads in “see”-Tags?
Today when documenting some methods of a class using XML-Comments, I got a ReSharper message saying
However, ReSharper did not provide any automatic solution. So I had to find one myself
Read the rest of this entry »