stubbed GroupController to include Update and Delete endpoints

#59
This commit is contained in:
Chris.Watts90@outlook.com 2017-03-09 16:05:01 +00:00
parent 6cddabba38
commit dc80fd9ba4

View File

@ -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();
}
}
}