System.Web.Mail has been deprecated, use System.Net.Mail instead.
System.Net.Mail namespace is used to send electronil mail to Simple Mail Transfer Protocol (SMTP) server for delivery.
2. What is generics?
Generic is a language feature introduced in .Net 2.0. Generics introduce to the .NET Framework the concept of type parameters, which make it possible to design classes and methods that defer the specification of one or more types until the class or method is declared and instantiated by client code. Use of generics makes your code type safe. It is a very efficient way to work with collections.
C# does not allow non-type template parameters.
C# does not support explicit specialization; that is, a custom implementation of a template for a specific type.
C# does not allow the type parameter to be used as the base class for the generic type.
In C#, a generic type parameter cannot itself be a generic, although constructed types can be used as generics. C++ does allow template parameters.
Generics and Collection Initializer in .Net
3. What is boxing and unboxing?
Boxing is the process of converting a value type to the type object. When the CLR boxes a value type, it wraps the value inside a System.Object and stores it on the managed heap.
Unboxing extracts the value type from the object. Boxing is implicit; unboxing is explicit. The concept of boxing and unboxing underlies the C# unified view of the type system, in which a value of any type can be treated as an object.
int i = 12; object o = i;
Unboxing
o = 12;
i = (int)o;
4. What is the difference between DataRowCollection.Remove method and DataRowCollection.Delete method?
DataRowCollection.Remove method removes a DataRow from a DataTable where as DataRowCollection.Delete method marks a row for deletion.
Calling Remove is the same as calling Delete and then calling AcceptChanges.
You can also use the Clear method to remove all members of the collection at one time.
5. What are Extension Methods?
Extension methods enable you to "add" methods to existing types without creating a new derived type, recompiling, or otherwise modifying the original type. Extension methods are a special kind of static method, but they are called as if they were instance methods on the extended type.
6. What is the use of System.Threading.ReaderWriterLockSlim Class?