Website Summary Files Commits Branches @commit @diff @stats
path: root / API / Controllers / UserController.cs
diff options
context:
space:
mode:
Commit6a662373c8300f108ceedaa32b5a076352cb4da6 (patch)
Author
 transtrike <transtrike@gmail.com>
2020-12-10 14:15:38 +0200
Committer
 transtrike <transtrike@gmail.com>
2020-12-10 14:15:38 +0200
Files7adc70ab5829fea4f869906591aa32e4cf55666f /API/Controllers/UserController.cs
DevHive-6a662373c8300f108ceedaa32b5a076352cb4da6.tar
DevHive-6a662373c8300f108ceedaa32b5a076352cb4da6.tar.gz
DevHive-6a662373c8300f108ceedaa32b5a076352cb4da6.zip
Parentee80c6ff969b5b4cfc3d1292f15928fc8bd2d667 (diff)
Implemented all HTTP Methods
1 files changed, 8 insertions, 6 deletions
-rw-r--r--API/Controllers/UserController.cs14
diff --git a/API/Controllers/UserController.cs b/API/Controllers/UserController.cs
index c2d6f2c..22555c6 100644
--- a/API/Controllers/UserController.cs
+++ b/API/Controllers/UserController.cs
@@ -24,14 +24,12 @@ namespace API.Controllers
[HttpPost]
public async Task<HttpStatusCode> Create([FromBody] UserDTO userDTO)
{
- HttpStatusCode returnStatusCode = await this._service.CreateUser(userDTO);
-
- return returnStatusCode;
+ return await this._service.CreateUser(userDTO);
}
//Read
[HttpGet]
- public async Task<string> GetById(int id)
+ public async Task<string> GetById(int id)
{
return await this._service.GetUserById(id);
}
@@ -43,7 +41,11 @@ namespace API.Controllers
return await this._service.UpdateUser(id, userDTO);
}
- // //Delete
- // [HttpDelete]
+ //Delete
+ [HttpDelete]
+ public async Task<HttpStatusCode> Delete(int id)
+ {
+ return await this._service.DeleteUser(id);
+ }
}
}