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.2KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Web.Http;
  3. using iiie.WebApiUtils.BusinessManager;
  4. using iiie.WebApiUtils.DBO;
  5. using WebAPiUtils_test.BusinessManager;
  6. using WebAPiUtils_test.DBO;
  7. namespace WebAPiUtils_test.Controllers
  8. {
  9. public class ValuesController : ApiController
  10. {
  11. [HttpGet]
  12. [Route("api/values/{id}")]
  13. public ValuesDboGet Get(int id)
  14. {
  15. return BMRHandler<ValuesDboGet>.Handle(ValuesBusiness.Get(id), Request);
  16. }
  17. [HttpGet]
  18. [Route("api/values/contains")]
  19. public DboGetMultiple<ValuesDboGet> Contains(string text, int page = 0, int perPage = Int32.MaxValue)
  20. {
  21. return BMRHandler<DboGetMultiple<ValuesDboGet>>.Handle(ValuesBusiness.Contains(text, page, perPage), Request);
  22. }
  23. [HttpPost]
  24. [Route("api/values/edit/{id}")]
  25. public bool Edit(long id, ValuesDboEdit obj)
  26. {
  27. return BMRHandler<bool>.Handle(ValuesBusiness.Edit(obj, id), Request);
  28. }
  29. [HttpPost]
  30. [Route("api/values/add")]
  31. public long Edit(ValuesDboAdd obj)
  32. {
  33. return BMRHandler<long>.Handle(ValuesBusiness.Add(obj), Request);
  34. }
  35. }
  36. }