Urgent.News

What's breaking now, across thousands of outlets.

Tech

Your first ASP.NET App: Controllers

Hello! In this tutorial we continue build your own ASP.NET Service! Requirements IDE like Visual Studio/JetBrains Rider .NET >= 10 Base C# skill Creating controller Lets create our Controller, create file "MyController.cs" Image will like this namespace ExampleProject ; public class MyController { } Let's set base configuration using Microsoft.AspNetCore.Mvc ; namespace ExampleProject ; [ Route (…

This article provides a step-by-step guide to creating your first ASP.NET application with controllers. It starts by setting up the necessary requirements, including an IDE like Visual Studio or JetBrains Rider, .NET version 10, and basic C# skills. The tutorial then demonstrates how to create a new controller file named 'MyController.cs' and set up the base configuration using the 'Microsoft.AspNetCore.Mvc' namespace.

The author shows how to add an endpoint within the controller, replacing the default 'MapGet' method with a custom 'HttpGet' method that returns a 'Hello, world!' message. Finally, the article explains how to integrate the controller into the 'Program.cs' file using the 'AddControllers' method and run the application, which will display the 'Hello, world!' message when accessed via the specified URL.

Brief written by urgent.news from Dev.to's own syndicated text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Hacking VaultGate: Three Paths to One Flag

Target: http://192.168.122.1:3000 — a local Docker deployment of VaultGate on my lab network (your target IP will differ).

  • Three independent paths lead to the flag CTF{vaultgatethreepathsoneflag}
  • Path 1: Guess admin password, access maintenance console, pivot through helper service
  • Path 2: Exploit outdated dependency to run commands without logging in

More from Sunday 13 September →