From c3c52965ed7019293ad27884dc8bf84bc6bc2bc7 Mon Sep 17 00:00:00 2001 From: khwezi Date: Mon, 9 Mar 2026 16:56:20 +0200 Subject: [PATCH] Added demo controller --- SampleApi/Controllers/DemoController.cs | 43 +++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 SampleApi/Controllers/DemoController.cs diff --git a/SampleApi/Controllers/DemoController.cs b/SampleApi/Controllers/DemoController.cs new file mode 100644 index 0000000..7052ec2 --- /dev/null +++ b/SampleApi/Controllers/DemoController.cs @@ -0,0 +1,43 @@ +using Microsoft.AspNetCore.Mvc; + +// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 + +namespace SampleApi.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class DemoController : ControllerBase + { + // GET: api/ + [HttpGet] + public IEnumerable Get() + { + return new string[] { "value1", "value2" }; + } + + // GET api//5 + [HttpGet("{id}")] + public string Get(int id) + { + return "value"; + } + + // POST api/ + [HttpPost] + public void Post([FromBody] string value) + { + } + + // PUT api//5 + [HttpPut("{id}")] + public void Put(int id, [FromBody] string value) + { + } + + // DELETE api//5 + [HttpDelete("{id}")] + public void Delete(int id) + { + } + } +}