public static void UpdateStudentAccount(StudentAccount studentAccount) { Console.WriteLine( $">> Updating the student account {studentAccount.StudentAccountId} in database..." ); Thread.Sleep(1000); CachingServices.Invalidation.Invalidate(studentAccount); }
public static StudentAccount GetStudentAccount(int id) { Console.WriteLine($">> Retrieving the student account {id} from database..."); Thread.Sleep(1000); var account = new StudentAccount { StudentAccountId = id }; CachingServices.CurrentContext.AddDependency(account); return(account); }