Moved CardsController, SwipeDataController, UsersController, ValuesController to a "Controllers" dir.

This commit is contained in:
Chris.Watts90@outlook.com 2017-02-03 12:21:54 +00:00
parent 4ac6b2475b
commit 532bf2b105
4 changed files with 3 additions and 4 deletions

View File

@ -9,13 +9,11 @@ namespace WindowsDataCenter
[RoutePrefix("api/swipedata")]
public class SwipeDataController : ApiController
{
//private SQLiteConnection _connection;
private readonly IRepository _repo;
public SwipeDataController(IRepository repo)
{
if(repo == null) throw new ArgumentNullException();
_repo = repo;
//_connection = conn;
}
[HttpPost]
@ -38,7 +36,6 @@ namespace WindowsDataCenter
//}
//else
//{
// //TODO: handle when more than one comes back. should NEVER happen but....
// userId = cardIdQuery.First().UserId_FK;
//}

View File

@ -42,6 +42,7 @@ namespace WindowsDataCenter
public IHttpActionResult CreateUser([FromBody] User user)
{
_repo.UpdateUser(user);
//TODO return ID.
return ResponseMessage(new HttpResponseMessage(HttpStatusCode.OK) {Content = new StringContent("unknownIdTODO")});
}
@ -50,10 +51,11 @@ namespace WindowsDataCenter
public IHttpActionResult EditUser([FromBody] User user)
{
_repo.UpdateUser(user);
//TODO: MUST HAVE - return user id!
return
ResponseMessage(new HttpResponseMessage(HttpStatusCode.Created)
{
//TODO: return ID
Content = new StringContent("TODO:return UserID")
});
}