public virtual void Handle(TMessage message, IProvideProjections store) { Logger.DebugFormat("Remove projections because of a message: {0}", message); var filterValues = GetFilterValues(message); Remove(store, filterValues); }
public virtual void Handle(TMessage message, IProvideProjections store) { var translatedMessages = Translate(message); foreach (var translatedMessage in translatedMessages) { Handle(translatedMessage, store); } }
public virtual void Handle(TMessage message, IProvideProjections store) { Logger.DebugFormat("Insert a projection because of a message: {0}", message); var projection = new TProjection(); Map(message, projection); Insert(store, projection); }
private static void Remove(IProvideProjections store, IEnumerable <FilterValue> filterValues) { Logger.Debug("Remove projections."); try { store.Remove <TProjection>(filterValues); } catch (Exception e) { Logger.ErrorException("Failed to remove projections.", e); throw; } }
private static void Insert(IProvideProjections store, TProjection projection) { Logger.DebugFormat("Insert a projection: {0}", projection); try { store.Insert(projection); } catch (Exception e) { Logger.ErrorException("Failed to insert a projection.", e); throw; } }
private static void Update(IProvideProjections store, TProjection projection) { Logger.DebugFormat("Update a projection: {0}", projection); try { store.Update(projection); } catch (Exception e) { Logger.ErrorException("Failed to update a projection.", e); throw; } }
private static TProjection Read(IProvideProjections store, IEnumerable <FilterValue> filterValues) { Logger.Debug("Read a projection."); try { return(store.Read <TProjection>(filterValues).SingleOrDefault()); } catch (Exception e) { Logger.ErrorException("Failed to read a projection.", e); throw; } }
private void Handle(TTranslatedMessage message, IProvideProjections store) { Logger.DebugFormat("Handle a translated message: {0}", message); try { _strategy.Handle(message, store); } catch (Exception e) { Logger.ErrorException("Failed to handle translated message.", e); throw; } }
public virtual void Handle(TMessage message, IProvideProjections store) { Logger.DebugFormat("Update projection(s) because of a message: {0}", message); var filterValues = GetFilterValues(message); var projections = Read(store, filterValues); foreach (var projection in projections) { Logger.DebugFormat("A projection found: {0}", projection); Map(message, projection); Update(store, projection); } }
public virtual void Handle(TMessage message, IProvideProjections store) { Logger.DebugFormat("Save a projection because of a message: {0}", message); var filterValues = GetFilterValues(message); var projection = Read(store, filterValues); if (projection == null) { Logger.Debug("No projections found."); projection = new TProjection(); MapKeys(message, projection); Map(message, projection); Insert(store, projection); } Logger.DebugFormat("A projection found: {0}", projection); Map(message, projection); Update(store, projection); }
public void Handle(TMessage message, IProvideProjections store) { }
public void Handle(TestMessage message, IProvideProjections store) { Counter++; }
public TestProvidersFactory(IProvideProjections provider) { _provider = provider; }
public void Handle(TMessage message, IProvideProjections projections) { EnsureStrategy(); _strategy.Handle(message, projections); }