Guest User

Untitled

a guest
Dec 15th, 2017
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. public class CustomerService
  2. {
  3. [CacheableResult(600)] // 600 seconds, 10 minutes cache policy
  4. public List<dynamic> ReturnCustomer()
  5. {
  6. var lstCustomer = new List<dynamic>();
  7.  
  8. var customer = new Customer
  9. {
  10. Id = 1,
  11. Name = "Acme Inc",
  12. Email = "acme@email.com"
  13. };
  14.  
  15. var customer1 = new Customer
  16. {
  17. Id = 2,
  18. Name = "Marvel Inc",
  19. Email = "Marvel@email.com"
  20. };
  21.  
  22. lstCustomer.Add(customer);
  23. lstCustomer.Add(customer1);
  24.  
  25. return lstCustomer;
  26. }
  27.  
  28. [AffectedCacheableMethods("ReturnCustomer")]
  29. public bool UpdateCustomer()
  30. {
  31. return true;
  32. }
  33. }
Add Comment
Please, Sign In to add comment