internal VertexTable GetRowForActiveVertex(string vertexName) { return(VertexTable.GetAll(_vertexTable) .Where(gn => vertexName == gn.VertexName && !string.IsNullOrEmpty(gn.InstanceName)) .Where(gn => gn.IsActive) .First()); }
internal void DeactivateVertexOnInstance(string vertexName, string instanceName) { var newActiveVertex = VertexTable.GetAll(_vertexTable) .Where(gn => instanceName == gn.InstanceName && vertexName == gn.VertexName) .First(); newActiveVertex.IsActive = false; TableOperation insertOperation = TableOperation.InsertOrReplace(newActiveVertex); _vertexTable.ExecuteAsync(insertOperation).Wait(); }
internal void ActivateVertexOnInstance(string vertexName, string instanceName) { var newActiveVertex = VertexTable.GetAll(_vertexTable) .Where(gn => instanceName == gn.InstanceName && vertexName == gn.VertexName) .First(); newActiveVertex.IsActive = true; TableOperation insertOperation = TableOperation.InsertOrReplace(newActiveVertex); _vertexTable.ExecuteAsync(insertOperation).Wait(); var procs = VertexTable.GetAll(_vertexTable) .Where(gn => vertexName == gn.VertexName && instanceName != gn.InstanceName); foreach (var proc in procs) { if (proc.IsActive) { proc.IsActive = false; TableOperation _insertOperation = TableOperation.InsertOrReplace(proc); _vertexTable.ExecuteAsync(_insertOperation).Wait(); } } }
internal VertexTable GetRowForDefaultInstance() { return(VertexTable.GetAll(_vertexTable).Where(gn => string.IsNullOrEmpty(gn.VertexName)).First()); }
internal VertexTable GetRowForInstanceVertex(string instanceName, string vertexName) { return(VertexTable.GetAll(_vertexTable).Where(gn => instanceName == gn.InstanceName && vertexName == gn.VertexName).First()); }