diff options
| author | transtrike <transtrike@gmail.com> | 2020-12-13 12:29:02 +0200 |
|---|---|---|
| committer | transtrike <transtrike@gmail.com> | 2020-12-13 12:29:02 +0200 |
| commit | 3abbc13bcc55e68740564457fff455c849a1cd8a (patch) | |
| tree | 84eadad792ff05ba171c75de9e9a5376aa8cf752 /API/Controllers/RoleController.cs | |
| parent | 3f9d6457360bba2eef24c013c5ba40fa92bf8cc7 (diff) | |
| download | DevHive-3abbc13bcc55e68740564457fff455c849a1cd8a.tar DevHive-3abbc13bcc55e68740564457fff455c849a1cd8a.tar.gz DevHive-3abbc13bcc55e68740564457fff455c849a1cd8a.zip | |
Ordering Models
Diffstat (limited to 'API/Controllers/RoleController.cs')
| -rw-r--r-- | API/Controllers/RoleController.cs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/API/Controllers/RoleController.cs b/API/Controllers/RoleController.cs new file mode 100644 index 0000000..20179f4 --- /dev/null +++ b/API/Controllers/RoleController.cs @@ -0,0 +1,36 @@ +using System; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +using API.Database; +using API.Service; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; + +namespace API.Controllers +{ + [ApiController] + [Route("/api/[controller]")] + public class RoleController + { + private readonly RoleService _service; + + public RoleController(DevHiveContext context) + { + this._service = new RoleService(context); + } + + [HttpPost] + public Task<IActionResult> Create(string name) + { + return this._service.CreatePost(name); + } + + [HttpGet] + public Task<IActionResult> ShowPost(uint postId) + { + return this._service.GetPostById(postId); + } + } +} |
