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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 : BMRHandler
  10. {
  11. [HttpGet]
  12. [Route("api/values/{id}")]
  13. public ValuesDboGet Get(int id)
  14. {
  15. return Handle(ValuesBusiness.Get(id));
  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 Handle(ValuesBusiness.Contains(text, page, perPage));
  22. }
  23. [HttpPost]
  24. [Route("api/values/edit/{id}")]
  25. public bool Edit(long id, ValuesDboEdit obj)
  26. {
  27. return Handle(ValuesBusiness.Edit(obj, id));
  28. }
  29. [HttpPost]
  30. [Route("api/values/add")]
  31. public long Add(ValuesDboAdd obj)
  32. {
  33. return Handle(ValuesBusiness.Add(obj));
  34. }
  35. [HttpPost]
  36. [Route("api/values/adddbo")]
  37. public ValuesDboGet AddDbo(ValuesDboAdd obj)
  38. {
  39. return Handle(ValuesBusiness.AddDbo(obj));
  40. }
  41. }
  42. }