diff options
| author | transtrike <transtrike@gmail.com> | 2020-12-10 11:28:23 +0200 |
|---|---|---|
| committer | transtrike <transtrike@gmail.com> | 2020-12-10 11:28:23 +0200 |
| commit | 4e4ad8b4ba9938cc3f32bce3c606d73560267604 (patch) | |
| tree | 811559069901902256e8cf96fbcb850548367069 /API/Service | |
| parent | cec7ddcbfaf46443b14bc0bc119cc8b0ff5579b0 (diff) | |
| download | DevHive-4e4ad8b4ba9938cc3f32bce3c606d73560267604.tar DevHive-4e4ad8b4ba9938cc3f32bce3c606d73560267604.tar.gz DevHive-4e4ad8b4ba9938cc3f32bce3c606d73560267604.zip | |
Testig API with HTTP Post in User
Diffstat (limited to 'API/Service')
| -rw-r--r-- | API/Service/UserService.cs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/API/Service/UserService.cs b/API/Service/UserService.cs new file mode 100644 index 0000000..a2d671a --- /dev/null +++ b/API/Service/UserService.cs @@ -0,0 +1,33 @@ +using System.Net; +using System.Net.Http; +using System.Net.Http.Json; +using System.Text.Json.Serialization; +using System.Threading.Tasks; +using API.Database; +using Microsoft.AspNetCore.Mvc; +using Models.Classes; +using Models.DTOs; +using Newtonsoft.Json; + +namespace API.Service +{ + public class UserService + { + private readonly DbRepository<User> _dbRepository; + + public UserService(DevHiveContext context) + { + this._dbRepository = new DbRepository<User>(context); + } + + [HttpPost] + public async Task<HttpStatusCode> CreateUser(UserDTO userDTO) + { + //TODO: MAKE VALIDATIONS OF PROPER REQUEST + //UserDTO newUser = JsonConvert.DeserializeObject<UserDTO>(userDTO); + + //await this._dbRepository.AddAsync(newUser); + return HttpStatusCode.OK; + } + } +}
\ No newline at end of file |
