aboutsummaryrefslogtreecommitdiff
path: root/API/Controllers/UserController.cs
diff options
context:
space:
mode:
authortranstrike <transtrike@gmail.com>2020-12-10 11:28:23 +0200
committertranstrike <transtrike@gmail.com>2020-12-10 11:28:23 +0200
commit4e4ad8b4ba9938cc3f32bce3c606d73560267604 (patch)
tree811559069901902256e8cf96fbcb850548367069 /API/Controllers/UserController.cs
parentcec7ddcbfaf46443b14bc0bc119cc8b0ff5579b0 (diff)
downloadDevHive-4e4ad8b4ba9938cc3f32bce3c606d73560267604.tar
DevHive-4e4ad8b4ba9938cc3f32bce3c606d73560267604.tar.gz
DevHive-4e4ad8b4ba9938cc3f32bce3c606d73560267604.zip
Testig API with HTTP Post in User
Diffstat (limited to 'API/Controllers/UserController.cs')
-rw-r--r--API/Controllers/UserController.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/API/Controllers/UserController.cs b/API/Controllers/UserController.cs
new file mode 100644
index 0000000..d9b55db
--- /dev/null
+++ b/API/Controllers/UserController.cs
@@ -0,0 +1,41 @@
+using System.Net;
+using System.Net.Http;
+using System.Threading.Tasks;
+using API.Database;
+using API.Service;
+using Microsoft.AspNetCore.Mvc;
+using Models.Classes;
+using Models.DTOs;
+
+namespace API.Controllers
+{
+ [ApiController]
+ [Route("/api/[controller]")]
+ public class UserController: ControllerBase
+ {
+ private readonly UserService _service;
+
+ public UserController(DevHiveContext context)
+ {
+ this._service = new UserService(context);
+ }
+
+ //Create
+ [HttpPost]
+ public async Task<HttpStatusCode> Create([FromForm] UserDTO userDTO)
+ {
+ HttpStatusCode returnStatusCode = await this._service.CreateUser(userDTO);
+
+ return returnStatusCode;
+ }
+
+ //Read
+ // [HttpGet]
+
+ // //Update
+ // [HttpPut]
+
+ // //Delete
+ // [HttpDelete]
+ }
+} \ No newline at end of file