From dc80fd9ba4ba32c997f53f805f4983757de29209 Mon Sep 17 00:00:00 2001 From: "Chris.Watts90@outlook.com" Date: Thu, 9 Mar 2017 16:05:01 +0000 Subject: [PATCH] stubbed GroupController to include Update and Delete endpoints #59 --- .../Controllers/GroupController.cs | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/GroupController.cs b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/GroupController.cs index 7e3f310..c878b43 100644 --- a/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/GroupController.cs +++ b/DataCenter_Windows/WindowsDataCenter/WindowsDataCenter/Controllers/GroupController.cs @@ -7,7 +7,7 @@ namespace WindowsDataCenter [RoutePrefix("api/groups")] public class GroupController:ApiController { - private IRepository _repo; + private readonly IRepository _repo; public GroupController(IRepository repo) { if(repo == null) throw new ArgumentNullException(nameof(repo)); @@ -26,10 +26,26 @@ namespace WindowsDataCenter [Route("create")] public IHttpActionResult CreateGroup([FromBody] Group group) { - var groupId = -1; - var resp = _repo.CreateGroup(group, out groupId); + int groupId; + _repo.CreateGroup(group, out groupId); return Ok(groupId); } + + [HttpDelete] + [Route("delete")] + public IHttpActionResult DeleteGroup([FromUri]int groupId) + { + //_repo.DeleteGroup(groupId); + throw new NotImplementedException(); + } + + [HttpPost] + [Route("edit")] + public IHttpActionResult UpdateGroup([FromBody] Group group) + { + //_repo.UpdateGroup(group); + throw new NotImplementedException(); + } } }