private void CreateConfigurationInfos() { configurationInfos = new Dictionary <Type, SagaConfigurationInfo>(); var sagaTypes = typeExplorer.GetAllTypes() .Where(x => x.IsClass && typeof(IConventionBasedSaga).IsAssignableFrom(x) && !x.IsAbstract && !x.IsGenericTypeDefinition); foreach (Type sagaType in sagaTypes) { configurationInfos.Add(sagaType, SagaConventionConfigurationScanner.GetSagaConfiguration(sagaType)); } }
public static SagaConfigurationInfo GetSagaConfigurationInfo(Type sagaType) { if (!typeof(IConventionBasedSaga).IsAssignableFrom(sagaType)) { throw new ArgumentException($"{sagaType} is not an IConventionBasedSaga"); } if (configurationInfos == null) { return(SagaConventionConfigurationScanner.GetSagaConfiguration(sagaType)); } SagaConfigurationInfo configurationInfo; if (!configurationInfos.TryGetValue(sagaType, out configurationInfo)) { throw new ArgumentException($"Unknown saga type to get convention configuration info for: " + sagaType.FullName); } return(configurationInfo); }