protected override Frame buildPersistenceFrame(SagaStateExistence existence, Variable sagaId, Type sagaStateType, ref Variable loadedState) { var frame = new InMemorySagaPersistenceFrame(sagaStateType, sagaId, existence); if (existence == SagaStateExistence.Existing) { loadedState = frame.Document; } return(frame); }
public Frame DeterminePersistenceFrame(SagaStateExistence existence, ref Variable sagaId, Type sagaStateType, Variable existingState, out Variable loadedState) { loadedState = existingState; if (existence == SagaStateExistence.New) { var prop = FindIdProperty(sagaStateType); sagaId = new Variable(prop.PropertyType, existingState.Usage + "." + prop.Name); } var frame = new InMemorySagaPersistenceFrame(sagaStateType, sagaId, existence); if (existence == SagaStateExistence.Existing) { loadedState = frame.Document; } return(frame); }