<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Anoop</title>
    <description>The latest articles on DEV Community by Anoop (@anoop_34248d0aad2f6f28e73).</description>
    <link>https://dev.to/anoop_34248d0aad2f6f28e73</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2900890%2Faf8619e9-2a1c-4bbf-a5b9-e9193f79bf7e.png</url>
      <title>DEV Community: Anoop</title>
      <link>https://dev.to/anoop_34248d0aad2f6f28e73</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anoop_34248d0aad2f6f28e73"/>
    <language>en</language>
    <item>
      <title>Action vs. Function in C# – What's the Difference?</title>
      <dc:creator>Anoop</dc:creator>
      <pubDate>Wed, 05 Mar 2025 06:24:47 +0000</pubDate>
      <link>https://dev.to/anoop_34248d0aad2f6f28e73/action-vs-function-in-c-whats-the-difference-9an</link>
      <guid>https://dev.to/anoop_34248d0aad2f6f28e73/action-vs-function-in-c-whats-the-difference-9an</guid>
      <description>&lt;p&gt;In C#, both Action and Function (Func&amp;lt;&amp;gt;) are delegates, but they serve different purposes.&lt;/p&gt;

&lt;p&gt;🔹 Action ➡ Represents a method that does not return a value (void).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Action printMessage = message =&amp;gt; Console.WriteLine(message);&lt;br&gt;
printMessage("Hello, LinkedIn!"); &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here, printMessage takes a string as input and prints it but doesn’t return anything.&lt;/p&gt;

&lt;p&gt;🔹 Func ➡ Represents a method that returns a value.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Func add = (a, b) =&amp;gt; a + b;&lt;br&gt;
int sum = add(5, 10);&lt;br&gt;
Console.WriteLine(sum); // Output: 15&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here, add takes two integers and returns their sum.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Takeaway: Use Action when you don’t need a return value and Func when you do!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
