![Copy image Copy image](icons/copycode.gif)
![CopyHover image CopyHover image](copycodeHighlight.gif)
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.
![](collapse_all.gif)
C# | Visual Basic | Visual C++ | F# |
public ReadOnlyCollection<PlQueryVariables> ToList()
Public Function ToList As ReadOnlyCollection(Of PlQueryVariables)
public: ReadOnlyCollection<PlQueryVariables^>^ ToList()
member ToList : unit -> ReadOnlyCollection<PlQueryVariables>
![](collapse_all.gif)
ReadOnlyCollection<(Of <(<'PlQueryVariables>)>)>
A ReadOnlyCollection of PlQueryVariables containing all solutions of the query.
A ReadOnlyCollection of PlQueryVariables containing all solutions of the query.
![](collapse_all.gif)
![]() |
|
---|---|
public void Test_multi_goal_ToList() { 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(_abc[i++], t.A); } |
Assembly: SwiPlCs (Module: SwiPlCs.dll) Version: 1.1.60605.0 (1.1.60605.0)