Lädt...

🔧 Action vs. Function in C# – What's the Difference?


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

In C#, both Action and Function (Func<>) are delegates, but they serve different purposes.

🔹 Action ➡ Represents a method that does not return a value (void).

Action printMessage = message => Console.WriteLine(message);
printMessage("Hello, LinkedIn!");

Here, printMessage takes a string as input and prints it but doesn’t return anything.

🔹 Func ➡ Represents a method that returns a value.

Func add = (a, b) => a + b;
int sum = add(5, 10);
Console.WriteLine(sum); // Output: 15

Here, add takes two integers and returns their sum.

Key Takeaway: Use Action when you don’t need a return value and Func when you do!

...

🔧 Evaluation metric, objective function, loss function, cost function, scoring function, error function


📈 43.61 Punkte
🔧 Programmierung

🔧 Grok 3: AI Thông Minh Nhất Thế Giới


📈 28.6 Punkte
🔧 Programmierung

🕵️ Kèo Thẻ Phạt Vip66 Là Gì? 3 Lối Đánh Kèo Chậm Mà Chắc


📈 28.6 Punkte
🕵️ Reverse Engineering

🔧 KISS Principle: Giữ Mọi Thứ Đơn Giản Nhất Có Thể


📈 28.6 Punkte
🔧 Programmierung

🔧 Có thể bạn chưa biết (Phần 1)


📈 28.6 Punkte
🔧 Programmierung

🔧 Difference Between new Function() and new function() in JavaScript


📈 27.27 Punkte
🔧 Programmierung

🔧 Action vs. Function in C# – What's the Difference?


📈 25.42 Punkte
🔧 Programmierung

📰 Difference-in-Difference 101


📈 19.66 Punkte
🔧 AI Nachrichten

📰 Deep web vs. dark web: Is there a difference, what does the difference affect?


📈 19.66 Punkte
📰 IT Security Nachrichten

🔧 DAY-8 PSQL, Difference Function vs. Procedure


📈 18.55 Punkte
🔧 Programmierung

🔧 Difference between ( )=&gt;{ } and ( )=&gt;( ) aero function in JavaScript (JS)


📈 18.55 Punkte
🔧 Programmierung

🔧 function declarations vs function expressions in Javascript 🤔✌️


📈 17.44 Punkte
🔧 Programmierung

🔧 How to build HarmonyOS NEXT function and custom function?


📈 17.44 Punkte
🔧 Programmierung

🔧 Understanding Function.length, Function.name, Polymorphism, and NFE in JavaScript


📈 17.44 Punkte
🔧 Programmierung

🔧 How to add function and filter on an array and lamda function.


📈 17.44 Punkte
🔧 Programmierung

🔧 Azure Function with .NET Isolated Worker: Sharing Services Between API and Function Apps


📈 17.44 Punkte
🔧 Programmierung

🔧 JavaScript Function , First Class function / First Class Citizen in JavaScript


📈 17.44 Punkte
🔧 Programmierung

🔧 Configuring an AWS Lambda Function with Lambda Layers and Function URL Using Terraform


📈 17.44 Punkte
🔧 Programmierung

🔧 Do not use array.sort() Function Without a Compare Function in JavaScript


📈 17.44 Punkte
🔧 Programmierung

🔧 Understanding JavaScript Function Declarations: 'function' vs 'const'


📈 17.44 Punkte
🔧 Programmierung

🔧 為什麼 member function 不叫做 function member?


📈 17.44 Punkte
🔧 Programmierung

🔧 Make the OpenAI Function Calling Work Better and Cheaper with a Two-Step Function Call 🚀


📈 17.44 Punkte
🔧 Programmierung

🔧 Arrow function vs regular function in JavaScript. Which one to use? 🤷‍♂️


📈 17.44 Punkte
🔧 Programmierung

🔧 Arrow function vs regular function in JavaScript. Which one to use?


📈 17.44 Punkte
🔧 Programmierung

🔧 Building an Address Search Function with Amazon Location SDK and API key function


📈 17.44 Punkte
🔧 Programmierung

matomo