You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ValuesController.cs 754B

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Web.Http;
  4. using WebAPiUtils_test.DBO;
  5. namespace WebAPiUtils_test.Controllers
  6. {
  7. public class ValuesController : ApiController
  8. {
  9. // GET api/values
  10. public IEnumerable<string> Get()
  11. {
  12. throw new Exception("Something went wrong...");
  13. }
  14. // GET api/values/5
  15. public string Get(int id)
  16. {
  17. return "value";
  18. }
  19. // POST api/values
  20. public void Post([FromBody]MyDbo value)
  21. {
  22. }
  23. // PUT api/values/5
  24. public void Put(int id, [FromBody]string value)
  25. {
  26. }
  27. // DELETE api/values/5
  28. public void Delete(int id)
  29. {
  30. }
  31. }
  32. }