public static void CreateFilterNode(FilterWrapper objWrap) { Logger.WriteToLogFile(DBInteractor.Common.Utilities.GetCurrentMethod()); Logger.WriteObjectToLogFile <Filter>(objWrap.objfilter); Filter objfilter = objWrap.objfilter; SubCategory objSubCategory = objWrap.objSubCategory; var result = Neo4jController.m_graphClient.Cypher .Match("(A:" + objSubCategory.getLabel() + " { id :{ subcategoryid }})") .Create("(B:" + objfilter.getLabel() + "{ objFilter })") .Merge("(A)-[:" + Rel_SubCategory.subCategory_filter + "]->(B)") .WithParams(new { subcategoryid = objSubCategory.id, objFilter = objfilter }) .Return((B) => new { NodeCount = B.Count() }) .Results .Single(); if (result.NodeCount == 1) { Logger.WriteToLogFile("Successfully created Item"); } else { Logger.WriteToLogFile("unable to create Item"); } }
public IReadOnlyList<LightNodeFilterAttribute> GetFilters(ILightNodeOptions options, OperationContext context, IReadOnlyList<LightNodeFilterAttribute> originalFilters) { if (MessageBroker == null || Timer == null) return originalFilters; MessageBroker.Publish(context); if (originalFilters.Count == 0) return originalFilters; var array = new LightNodeFilterAttribute[originalFilters.Count]; for (int i = 0; i < originalFilters.Count; i++) { array[i] = new FilterWrapper(MessageBroker, Timer, originalFilters[i]); } return array; }
public IParallelGaussianFilter GetHighLevelImplementation() { IntPtr library = IntPtr.Zero; try { library = LoadLibrary(HLDllName); FilterWrapper filterWrapper = new FilterWrapper(library); return(filterWrapper); } catch (Exception) { FreeLibrary(library); throw new LibraryException($"Nie udało się załadować biblioteki '{HLDllName}'"); } }
public IParallelGaussianFilter GetAssemblyImplementation() { //ładuje wskażnik 0 IntPtr library = IntPtr.Zero; try { //przekazanie wskaźnika na początek pamięci library = LoadLibrary(AssemblyDllName); // zwracamy stworzony obiekt typu FilterWrapper FilterWrapper filterWrapper = new FilterWrapper(library); return(filterWrapper); } catch (Exception) { FreeLibrary(library); throw new LibraryException($"Nie udało się załadować biblioteki '{AssemblyDllName}'"); } }
public IReadOnlyList <LightNodeFilterAttribute> GetFilters(ILightNodeOptions options, OperationContext context, IReadOnlyList <LightNodeFilterAttribute> originalFilters) { if (MessageBroker == null || Timer == null) { return(originalFilters); } MessageBroker.Publish(context); if (originalFilters.Count == 0) { return(originalFilters); } var array = new LightNodeFilterAttribute[originalFilters.Count]; for (int i = 0; i < originalFilters.Count; i++) { array[i] = new FilterWrapper(MessageBroker, Timer, originalFilters[i]); } return(array); }
public override object Execute(ParameterList parameters, FunctionContextContainer context) { SitemapScope SitemapScope; Expression filter; if (parameters.TryGetParameter <SitemapScope>("SitemapScope", out SitemapScope) == false) { SitemapScope = SitemapScope.Current; } switch (SitemapScope) { case SitemapScope.Current: Guid currentPageId = PageRenderer.CurrentPageId; filter = Expression.Equal(_foreignKeyPropertyExpression, Expression.Constant(currentPageId)); break; case SitemapScope.All: filter = Expression.Constant(true); break; default: Guid pageId = PageRenderer.CurrentPageId; IEnumerable <Guid> pageIds = new FilterWrapper( pageId, SitemapScope, TableVersion.Get(typeof(IPageStructure)), PageStructureInfo.GetAssociatedPageIds(pageId, SitemapScope)); Expression <Func <Guid, bool> > containsExpression = f => pageIds.Contains(f); filter = Expression.Invoke(containsExpression, _foreignKeyPropertyExpression); break; } return(Expression.Lambda <Func <T, bool> >(filter, new ParameterExpression[] { _parameterExpression })); }