From 6a662373c8300f108ceedaa32b5a076352cb4da6 Mon Sep 17 00:00:00 2001 From: transtrike Date: Thu, 10 Dec 2020 14:15:38 +0200 Subject: Implemented all HTTP Methods --- API/Controllers/UserController.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'API/Controllers/UserController.cs') 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 Create([FromBody] UserDTO userDTO) { - HttpStatusCode returnStatusCode = await this._service.CreateUser(userDTO); - - return returnStatusCode; + return await this._service.CreateUser(userDTO); } //Read [HttpGet] - public async Task GetById(int id) + public async Task 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 Delete(int id) + { + return await this._service.DeleteUser(id); + } } } -- cgit v1.2.3