AddProvision.cs 555 B

123456789101112131415161718192021
  1. using API_sm.BaseConnection;
  2. using API_sm.ModelBase;
  3. using Microsoft.AspNetCore.Mvc;
  4. namespace API_sm.Controllers
  5. {
  6. [Route("api/[controller]")]
  7. [ApiController]
  8. [ApiExplorerSettings(GroupName = "Добавление")]
  9. public class AddProvision : ControllerBase
  10. {
  11. ApplicationContext db = new ApplicationContext();
  12. [HttpPost]
  13. public IActionResult Index(Provision_of_services provision)
  14. {
  15. db.Add(provision);
  16. db.SaveChanges();
  17. return Ok(provision);
  18. }
  19. }
  20. }