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

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System.Collections.Generic;
  2. using System.Web.Http;
  3. using iiie.Logs.DataAccess;
  4. using iiie.Logs.DBO;
  5. namespace Logs_test.Controllers
  6. {
  7. public class ValuesController : ApiController
  8. {
  9. // GET api/values
  10. public IEnumerable<string> Get()
  11. {
  12. return new string[] { "value1", "value2" };
  13. }
  14. // GET api/values/5
  15. public string Get(int id)
  16. {
  17. Logger.Error<int>(ResultStatus.DBError, "my private data", "my public data");
  18. Logger.Error<int>(ResultStatus.DBError, "my private/public data", "");
  19. Logger.Error<int>(ResultStatus.DBError, "my private data");
  20. var value = "value";
  21. if (OpResult<int>.Ok(42))
  22. value += " ok";
  23. if (!OpResult<int>.Error(ResultStatus.InputError, "", ""))
  24. value += " error";
  25. return value;
  26. }
  27. // POST api/values
  28. public void Post([FromBody]string 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. }