Skip to content

Instantly share code, notes, and snippets.

@bromne
Created December 28, 2016 05:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bromne/eeaa0834eeee54315fa380a00b250cd7 to your computer and use it in GitHub Desktop.
Save bromne/eeaa0834eeee54315fa380a00b250cd7 to your computer and use it in GitHub Desktop.
Linq: type-unsafe
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
public class Test
{
public static void Main()
{
IEnumerable values = new List<string>() { "foo", "bar" };
IEnumerable<int> nums = from int n in values select n;
Console.WriteLine(nums.ToList());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment