Created
December 13, 2016 11:44
-
-
Save mcintyre321/ed0e34f68885d67c41aced5c7c0c0213 to your computer and use it in GitHub Desktop.
JSIL LINQ error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using JSIL; | |
using JSIL.Meta; | |
using System.Collections.Generic; | |
using System.Linq; | |
public static class Program { | |
public static void Main () { | |
Dictionary<string, string[]> data = new Dictionary<string, string[]>(){ | |
{ "a", new []{"b"}}, | |
{ "b", new string[0]} | |
}; | |
var xs = data.Keys.Select(k => new X{ Name = k}).ToList(); | |
xs.ForEach(x => x.Refs = data[x.Name].Select(y => xs.Single(z => z.Name == y)).ToArray()); | |
Console.WriteLine("Hello JSIL World!"); | |
} | |
public class X | |
{ | |
public string Name {get;set;} | |
public X[] Refs {get;set;} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment