TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Pavel
1.6k
170
51.2k
How to convert the result of LINQ query to List
Sep 20 2012 4:10 AM
Hello,
Here is function, that I use the list of permutations:
public static IEnumerable<IEnumerable<T>> Permute<T>(IEnumerable<T> list)
{
if (list.Count() == 1)
return new List<IEnumerable<T>> { list };
return list.Select((a, i1) => Permute(
list.Where((b, i2) => i2 != i1)).Select(
b => (new List<T> { a }).Union(b))
).SelectMany(c => c);
}
I use it in the following way:
var SFP_vars = Permute(SFP);
Where SFP is array of bytes:
byte[] SFP = new byte[7] { 0, 1, 2, 3, 4, 5, 6 };
There is other variable:
List<byte[]> lst_SFP = new List<byte[]>();
Now my question:
How to assign the value of SFP_vars to lst_SFP ?
lst_SFP = SFP_vars.ToList()
doesn't work.
Thanks in advance.
Pavel.
Reply
Answers (
6
)
Anonymous Types error: Retrieving data from different columns using linq
What is the difference between console.readline() and console.readkey()?