Skip to content

Instantly share code, notes, and snippets.

@thiagoloureiro
Last active December 14, 2017 19:42
Show Gist options
  • Save thiagoloureiro/9facfddc56bfb01d644575add6233a9d to your computer and use it in GitHub Desktop.
Save thiagoloureiro/9facfddc56bfb01d644575add6233a9d to your computer and use it in GitHub Desktop.
public class CustomerService
{
[CacheableResult(600)] // 600 seconds, 10 minutes cache policy
public List<dynamic> ReturnCustomer()
{
var lstCustomer = new List<dynamic>();
var customer = new Customer
{
Id = 1,
Name = "Acme Inc",
Email = "[email protected]"
};
var customer1 = new Customer
{
Id = 2,
Name = "Marvel Inc",
Email = "[email protected]"
};
lstCustomer.Add(customer);
lstCustomer.Add(customer1);
return lstCustomer;
}
[AffectedCacheableMethods("ReturnCustomer")]
public bool UpdateCustomer()
{
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment