1 <Type Name="Action<T>" FullName="System.Action<T>">
2 <TypeSignature Language="C#" Value="public delegate void Action<in T>(T obj);" />
4 <AssemblyName>mscorlib</AssemblyName>
5 <AssemblyVersion>2.0.0.0</AssemblyVersion>
6 <AssemblyVersion>4.0.0.0</AssemblyVersion>
9 <TypeParameter Name="T">
11 <ParameterAttribute>Contravariant</ParameterAttribute>
16 <BaseTypeName>System.Delegate</BaseTypeName>
19 <Parameter Name="obj" Type="T" />
22 <ReturnType>System.Void</ReturnType>
25 <typeparam name="T">The type. </typeparam>
26 <param name="obj">The object on which to perform an action.</param>
27 <summary>A delegate to a method that returns no values, and takes one parameter.</summary>
28 <remarks>Since the compiler can infer the types, you do not need to provide the type, this is typically used with the <see cref="T:System.Array.Foreach" /> method or the <see cref="T:System.Collections.Generic.List" />'s ForEach method.
30 <example><code lang="C#">
32 // Simple "echo" implementation
38 static void Main (string [] args)
40 Array.ForEach (args, print);
44 static void print (string a)
50 </code></example></remarks>
51 <since version=".NET 2.0" />