diff options
Diffstat (limited to 'Controllers/GroupsController.cs')
-rw-r--r-- | Controllers/GroupsController.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Controllers/GroupsController.cs b/Controllers/GroupsController.cs new file mode 100644 index 0000000..f81cc56 --- /dev/null +++ b/Controllers/GroupsController.cs @@ -0,0 +1,24 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using LibraryAPI.Models; +using LibraryAPI.Filters; + +namespace LibraryAPI.Controllers { + [Route("api/groups")] + [ApiController] + public class GroupsController : ControllerBase { + private readonly LibraryContext _context; + + public GroupsController(LibraryContext context) { + _context = context; + } + + [HttpPost] + public async Task<ActionResult> PostGroup(Group g) { + _context.Add(g); + await _context.SaveChangesAsync(); + + return Ok(); + } + } +} |