Write a simple C# script using ASP.NET Core 7 and Minimal API that replies "Hellow World" when any endpoint is called.
Here's a simple C# script using ASP.NET Core 7 and Minimal API that replies "Hello World" when any endpoint is called:
    using Microsoft.AspNetCore.Mvc;
    using Microsoft.AspNetCore.Http;
    using Microsoft.AspNetCore.Builder;

    var builder = WebApplication.CreateBuilder(args);

    var app = builder.Build();

    app.MapGet("/", () => "Hello World");

    app.Run();

In this script, we create a new WebApplication using the CreateBuilder method. We then use the MapGet method to map a GET request to the root endpoint ("/") to a lambda function that returns the string "Hello World". Finally, we call the Run method to start the application.

To run this script, save it as a .cs file (e.g. Program.cs) and run the following command in a terminal:

    dotnet run

This will start the application and listen for HTTP requests on port 5000. To test the application, open a web browser or HTTP client and navigate to http://localhost:5000. You should see the "Hello World" message displayed in the response.