Guest User

Untitled

a guest
Dec 15th, 2017
373
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. };
  13.  
  14. var customer1 = new Customer
  15. {
  16. Id = 2,
  17. Name = "Marvel Inc",
  18. };
  19.  
  20. lstCustomer.Add(customer);
  21. lstCustomer.Add(customer1);
  22.  
  23. return lstCustomer;
  24. }
  25.  
  26. [AffectedCacheableMethods("ReturnCustomer")]
  27. public bool UpdateCustomer()
  28. {
  29. return true;
  30. }
  31. }
Add Comment
Please, Sign In to add comment