public virtual T AddOrUpdatePayload <T>(PayloadFactory <T> addFactory, UpdatePayloadFactory <T> updateFactory) where T : class { if (this is T context) { return(context); } return(PayloadCache.AddOrUpdatePayload(addFactory, updateFactory)); }
public virtual T GetOrAddPayload <T>(PayloadFactory <T> payloadFactory) where T : class { if (this is T context) { return(context); } return(PayloadCache.GetOrAddPayload(payloadFactory)); }
public virtual bool TryGetPayload <T>(out T payload) where T : class { if (this is T context) { payload = context; return(true); } return(PayloadCache.TryGetPayload(out payload)); }
public virtual bool HasPayloadType(Type payloadType) { return(payloadType.GetTypeInfo().IsInstanceOfType(this) || PayloadCache.HasPayloadType(payloadType)); }