PutController.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using androidAPI.BaseConneckion;
  2. using androidAPI.ModelBase;
  3. using Microsoft.AspNetCore.Mvc;
  4. using Microsoft.AspNetCore.WebUtilities;
  5. using Microsoft.VisualBasic;
  6. using System.Net;
  7. using System.Reflection;
  8. namespace androidAPI.Controllers
  9. {
  10. [Route("api/[controller]")]
  11. [ApiController]
  12. [ApiExplorerSettings(GroupName = "Узнаем о собачках")]
  13. public class PutController : Controller
  14. {
  15. MainTheApplication oo = new MainTheApplication();
  16. //[Route("api/[controller]")]
  17. [HttpPut]
  18. public IActionResult Index(Inform pip)
  19. {
  20. Inform inform = oo.DogiTut.FirstOrDefault(x => x.idF == pip.idF);
  21. if (inform == null)
  22. {
  23. throw new NotImplementedException("This method is not implemented");
  24. }
  25. inform.nameDog = pip.nameDog;
  26. inform.ageDog = pip.ageDog;
  27. inform.idGender = pip.idGender;
  28. inform.idBreed = pip.idBreed;
  29. oo.SaveChanges();
  30. return Ok(inform);
  31. }
  32. }
  33. }