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 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Web.Http;
  4. using iiie.WebApiUtils.BusinessManager;
  5. using WebAPiUtils_test.BusinessManager;
  6. using WebAPiUtils_test.DBO;
  7. namespace WebAPiUtils_test.Controllers
  8. {
  9. public class ValuesController : ApiController
  10. {
  11. // GET api/values
  12. public IEnumerable<string> Get()
  13. {
  14. throw new Exception("Something went wrong...");
  15. }
  16. // GET api/values/5
  17. public ValuesDbo Get(int id)
  18. {
  19. return BMRHandler<ValuesDbo>.Handle(ValuesBusiness.Get(id), Request);
  20. }
  21. [HttpGet]
  22. [Route("api/values/contains")]
  23. public IEnumerable<ValuesDbo> Contains(string text)
  24. {
  25. return BMRHandler<IEnumerable<ValuesDbo>>.Handle(ValuesBusiness.Contains(text), Request);
  26. }
  27. // POST api/values
  28. public void Post([FromBody]MyDbo value)
  29. {
  30. }
  31. // PUT api/values/5
  32. public void Put(int id, [FromBody]string value)
  33. {
  34. }
  35. // DELETE api/values/5
  36. public void Delete(int id)
  37. {
  38. }
  39. }
  40. }