From fd60c446a29842227028ad20385e9a99950ea231 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 23 Nov 2017 20:32:08 +0200 Subject: First Draft of machines web service. --- .../Controllers/ValuesController.cs | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Software/Visual_Studio/Web/Tango.MachineService/Controllers/ValuesController.cs (limited to 'Software/Visual_Studio/Web/Tango.MachineService/Controllers/ValuesController.cs') diff --git a/Software/Visual_Studio/Web/Tango.MachineService/Controllers/ValuesController.cs b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/ValuesController.cs new file mode 100644 index 000000000..f76d66836 --- /dev/null +++ b/Software/Visual_Studio/Web/Tango.MachineService/Controllers/ValuesController.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Web.Http; +using Tango.MachineService.Models; + +namespace Tango.MachineService.Controllers +{ + public class ValuesController : ApiController + { + private static List persons = new List(); + + // GET api/values + public IEnumerable Get() + { + return persons; + } + + // GET api/values/5 + public Person Get(int id) + { + return persons[id]; + } + + // POST api/values + public Person Post([FromBody]Person person) + { + persons.Add(person); + return person; + } + + // PUT api/values/5 + public void Put(Person person) + { + + } + + // DELETE api/values/5 + public void Delete(int id) + { + } + } +} -- cgit v1.3.1