资 源 简 介
A growing collection of useful Extension Methods for .NET 3.5.
This is a project to simply collect and create useful extension methods for use with .NET. The following example makes use of the DefaultIfNull"<"T">" extension method which provides a type safe default value if the target variable is null. With nullable types you are then guaranteed a value when you state the Value property as demoed below.
```
string s = "Not null";
decimal? val2 = 3.33M;
string val3 = s.DefaultIfNull("Andy");
decimal val4 = val2.DefaultIfNull(2.22M).Value;
Console.WriteLine(val3);
Console.WriteLine(val4);
```