Swi-cs-pl - A CSharp class library to connect .NET languages with SWI-Prolog
ToList Method
SwiPlCs interface ► SbsSW.SwiPlCs ► PlQuery ► ToList()()()()
Create a ReadOnlyCollection<(Of <(<'T>)>)> of PlQueryVariables.
If calling ToList() all solutions of the query are generated and stored in the Collection.
Declaration Syntax
C# | Visual Basic | Visual C++ |
public ReadOnlyCollection<PlQueryVariables> ToList()
Public Function ToList As ReadOnlyCollection(Of PlQueryVariables)
public: ReadOnlyCollection<PlQueryVariables^>^ ToList()
Return Value
A ReadOnlyCollection of PlQueryVariables containing all solutions of the query.
Examples
CopyC#
public void Test_multi_goal_ToList() { string mm = "abc"; var results = from n in new PlQuery("L=[a,b,c], member(A, L)").ToList() select new { A = (string)n["A"] }; int i = 0; foreach (var t in results) Assert.AreEqual(mm[i++].ToString(), t.A); }