public List <PathREST> GetPaths(string from, string to, PathSpecification definition) { if (definition != null) { var fromId = Convert.ToInt32(from); var toId = Convert.ToInt32(to); var results = _codeProvider.CompileAssemblyFromSource(_compilerParameters, new[] { CreateSource(definition) }); if (results.Errors.HasErrors) { throw new Exception(CreateErrorMessage(results.Errors)); } var type = results.CompiledAssembly.GetType(PathDelegateClassName); var edgeCostDelegate = CreateEdgeCostDelegate(definition.Cost, type); var vertexCostDelegate = CreateVertexCostDelegate(definition.Cost, type); var edgePropertyFilterDelegate = CreateEdgePropertyFilterDelegate(definition.Filter, type); var vertexFilterDelegate = CreateVertexFilterDelegate(definition.Filter, type); var edgeFilterDelegate = CreateEdgeFilterDelegate(definition.Filter, type); List <Path> paths; if (_fallen8.CalculateShortestPath( out paths, definition.PathAlgorithmName, fromId, toId, definition.MaxDepth, definition.MaxPathWeight, definition.MaxResults, edgePropertyFilterDelegate, vertexFilterDelegate, edgeFilterDelegate, edgeCostDelegate, vertexCostDelegate)) { if (paths != null) { return(new List <PathREST>(paths.Select(aPath => new PathREST(aPath)))); } } } return(null); }