public static void AddOrUpdateInCache(this HttpSessionStateBase session, INakedObjectsFramework framework, INakedObject nakedObject, string url, ObjectFlag flag = ObjectFlag.None) { // only add transients if we are storing transients in the session if (!nakedObject.ResolveState.IsTransient() || nakedObject.Spec.IsCollection) { session.ClearPreviousTransients(nakedObject, flag); session.GetCache(flag).AddOrUpdateInCache(framework, nakedObject, url, flag); } }