internal bool TryGetCorrelationProperty(out CorrelationPropertyInfo sagaCorrelationProperty) { sagaCorrelationProperty = correlationProperty; return(sagaCorrelationProperty != null); }
void AttachEntity(IContainSagaData sagaEntity) { sagaId = sagaEntity.Id; UpdateModified(); Instance.Entity = sagaEntity; SagaId = sagaEntity.Id.ToString(); var properties = sagaEntity.GetType().GetProperties(); SagaMetadata.CorrelationPropertyMetadata correlatedPropertyMetadata; if (Metadata.TryGetCorrelationProperty(out correlatedPropertyMetadata)) { var propertyInfo = properties.Single(p => p.Name == correlatedPropertyMetadata.Name); var propertyValue = propertyInfo.GetValue(sagaEntity); var defaultValue = GetDefault(propertyInfo.PropertyType); var hasValue = propertyValue != null && !propertyValue.Equals(defaultValue); correlationProperty = new CorrelationPropertyInfo { PropertyInfo = propertyInfo, Value = propertyValue, HasExistingValue = hasValue }; } }
internal bool TryGetCorrelationProperty(out CorrelationPropertyInfo sagaCorrelationProperty) { sagaCorrelationProperty = correlationProperty; return sagaCorrelationProperty != null; }