ISagaState GetSagaStateFromCustom(IEvent evnt, IResolveDependencies resolver) { var evntType = evnt.GetType(); dynamic repo = resolver.ResolveOptional(typeof(IFindSagaState<>.Using<>).MakeGenericType(SagaStateType, evntType)); if (repo == null) { return null; } string fullName = repo.GetType().FullName; this.LogDebug($"Using saga repository '{fullName}' ..."); return repo.GetSagaData((dynamic) evnt); }
ISagaState GetSagaStateFromCustom(IEvent evnt, IResolveDependencies resolver) { var evntType = evnt.GetType(); dynamic repo = resolver.ResolveOptional(typeof(IFindSagaState <> .Using <>).MakeGenericType(SagaStateType, evntType)); if (repo == null) { return(null); } string fullName = repo.GetType().FullName; this.LogDebug($"Using saga repository '{fullName}' ..."); return(repo.GetSagaData((dynamic)evnt)); }
private bool SaveSagaToCustom(dynamic saga, IResolveDependencies resolver, bool isNew) { dynamic repo = resolver.ResolveOptional(typeof(ISaveSagaState <>).MakeGenericType(SagaStateType)); this.LogDebug("Saving saga {0} ...", SagaStateType.Name); if (repo == null) { return(false); } string fullName = repo.GetType().FullName; this.LogDebug("Using repository '{0}'", fullName); repo.Save(saga, isNew); return(true); }
private bool SaveSagaToCustom(dynamic saga, IResolveDependencies resolver, bool isNew) { dynamic repo = resolver.ResolveOptional(typeof (ISaveSagaState<>).MakeGenericType(SagaStateType)); this.LogDebug("Saving saga {0} ...", SagaStateType.Name); if (repo == null) return false; string fullName = repo.GetType().FullName; this.LogDebug("Using repository '{0}'", fullName); repo.Save(saga, isNew); return true; }