AddServises.cs 538 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 AddServises : ControllerBase
  10. {
  11. ApplicationContext db = new ApplicationContext();
  12. [HttpPost]
  13. public IActionResult Index(Services services)
  14. {
  15. db.Add(services);
  16. db.SaveChanges();
  17. return Ok(services);
  18. }
  19. }
  20. }