T IPayloadCache.AddOrUpdatePayload <T>(PayloadFactory <T> addFactory, UpdatePayloadFactory <T> updateFactory) { if (_payloadCache.TryGetPayload(out T existingPayload)) { return(_payloadCache.AddOrUpdatePayload(addFactory, updateFactory)); } if (_parentCache.TryGetPayload(out existingPayload)) { T Add() => updateFactory(existingPayload); return(_payloadCache.AddOrUpdatePayload(Add, updateFactory)); } return(_payloadCache.AddOrUpdatePayload(addFactory, updateFactory)); }
T PipeContext.AddOrUpdatePayload <T>(PayloadFactory <T> addFactory, UpdatePayloadFactory <T> updateFactory) { if (_payloadCache != null) { return(_payloadCache.AddOrUpdatePayload(addFactory, updateFactory)); } return(_context.AddOrUpdatePayload(addFactory, updateFactory)); }