コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
 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);
         }
     }
 }