blob: 20179f413d02981def56fe232d42e5c12533f684 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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);
}
}
}
|