private void CreateOrUpdateQuery(IProjectionsManager projectionManager, string projectionName, IList <string> streams, IList <Tuple <string, string> > types) { var newQuery = RenderQuery(streams, types); if (!projectionManager.Exists(projectionName)) { if (newQuery != null) { projectionManager.CreateContinuous(projectionName, newQuery); } } else { if (newQuery != null) { projectionManager.UpdateQuery(projectionName, newQuery); //projectionManager.Enable(projectionName); } else { projectionManager.Delete(projectionName); } } }
private void CreateOrUpdateQuery(IProjectionsManager projectionManager, string projectionName, IList<string> streams, IList<Tuple<string, string>> types) { var newQuery = RenderQuery(streams, types); if (!projectionManager.Exists(projectionName)) { if (newQuery != null) { projectionManager.CreateContinuous(projectionName, newQuery); } } else { if (newQuery != null) { projectionManager.UpdateQuery(projectionName, newQuery); //projectionManager.Enable(projectionName); } else { projectionManager.Delete(projectionName); } } }