12345678910111213141516171819 |
- using Microsoft.AspNetCore.Mvc;
- namespace API_development.Controllers
- {
- [Route("/api/[controller]")]
- [ApiController]
- [ApiExplorerSettings(GroupName ="Действия с хобби")]
- public class AddHobbiController : ControllerBase
- {
- ApplicationContext db = new ApplicationContext();
- [HttpPost]
- public IActionResult Index(Hobbies hobbi)
- {
- db.tbHobbies.Add(hobbi);
- db.SaveChanges();
- return Ok();
- }
- }
- }
|