Showing posts with label Await example in C#. Show all posts
Showing posts with label Await example in C#. Show all posts

30 April 2024

Await example in C#

Await example in C# 

using System;
using System.Threading.Tasks;

class Program {
 private static string result="test123";
 
 static void Main() {
   SaySomething();
   Console.WriteLine(result);
 }
 
 static async Task<string> SaySomething() {
   await Task.Delay(5);
   Console.WriteLine("test");
   result = "Hello world!";
    Console.WriteLine(result);
   return “Something”;
 }
}

Output

test123
test
Hello world!

Benefits of microservices

Benefits of microservices      1. Development & Team Agility Architecture- and language-neutral: Teams aren't locked into one progr...