How can we help you today? How can we help you today?
slaneyrw
Somewhere in the updates from version 5.x to 6.x ( I suspect when .NET 4.0 support was added ) the generation of C# for linq, initializers, extensions and anonymous methods has become atrocious. It is almost making the tool useless as C# language features in our codebase become common place. For example generator is now displaying direct execution of the static methods instead as an extension. ie Real Code private class ReflectorExample { public ReflectorExample() { List<string> aListOfStrings = new List< string >() { "One", "Two", "Three" }; int countOf = aListOfStrings.Where( item => item.Length == 3 ).Count(); } } Reflected code private class ReflectorExample { [CompilerGenerated] private static Func<string, bool> CS$<>9__CachedAnonymousMethodDelegate4; [CompilerGenerated] private static bool <.ctor>b__3(string item) { return (item.Length == 3); } // Methods public ReflectorExample() { List<string> <>g__initLocal2 = new List<string>(); <>g__initLocal2.Add("One"); <>g__initLocal2.Add("Two"); <>g__initLocal2.Add("Three"); List<string> aListOfStrings = <>g__initLocal2; if (CS$<>9__CachedAnonymousMethodDelegate4 == null) { CS$<>9__CachedAnonymousMethodDelegate4 = new Func<string, bool>(null, (IntPtr) <.ctor>b__3); } int countOf = Enumerable.Where<string>(aListOfStrings, CS$<>9__CachedAnonymousMethodDelegate4).Count<string>(); } } / comments
Somewhere in the updates from version 5.x to 6.x ( I suspect when .NET 4.0 support was added ) the generation of C# for linq, initializers, extensions and anonymous methods has become atrocious. It...
0 votes