UpdateUserController.cs 522 B

12345678910111213141516171819
  1. using Microsoft.AspNetCore.Mvc;
  2. namespace API_development.Controllers
  3. {
  4. [Route("/api/[controller]")]
  5. [ApiController]
  6. [ApiExplorerSettings(GroupName = "Действия с пользователем")]
  7. public class UpdateUserController : ControllerBase
  8. {
  9. ApplicationContext db = new ApplicationContext();
  10. [HttpPut]
  11. public IActionResult Index(Users user)
  12. {
  13. db.tbUsers.Update(user);
  14. db.SaveChanges();
  15. return Ok();
  16. }
  17. }
  18. }