FREE
10 enhanced classes per project.
$695 per developer
No limitation whatsoever.
[CacheConfiguration( AbsoluteExpiration = 10 )] class CustomerServices { [Cache] public static Customer GetCustomer(int id) { return DetailsSkipped(); } [InvalidateCache(nameof(GetCustomer))] public static void RenameCustomer(int id, string newName) { // Parameter 'id' of 'GetCustomer' method matched by name. DetailsSkipped(); } }
internal class AccountServices { [Cache] public static Account GetAccount(int id) { // Add an object-oriented dependency to GetMethod. CachingServices.CurrentContext.AddDependency(new AccountDependency(id)); return DetailsSkipped(); } [Cache] public static Account[] GetAccountsOfCustomer(int customerId) { // Implicitly adds dependencies to Account(1) and Account(2). return GetAccountIds(customerId).Select(GetAccount).ToArray(); } public static void UpdateAccount(Account account) { // Invalidates both GetAccount and GetAccountsOfCustomers. CachingServices.Invalidation.Invalidate( new AccountDependency(account.Id)); } }