Skip to content

Commit 07b1c0f

Browse files
committed
System.Collections referenced by default
1 parent 96de3a5 commit 07b1c0f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

RazorEngineCore/RazorEngineCompilationOptions.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ public class RazorEngineCompilationOptions
1616

1717
public HashSet<string> DefaultUsings { get; set; } = new HashSet<string>()
1818
{
19-
"System.Linq"
19+
"System.Linq",
20+
"System.Collections",
21+
"System.Collections.Generic"
2022
};
2123

2224
public RazorEngineCompilationOptions()
@@ -32,6 +34,8 @@ public RazorEngineCompilationOptions()
3234
Assembly.Load(new AssemblyName("Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")),
3335
typeof(RazorEngineTemplateBase).Assembly,
3436
typeof(System.Runtime.GCSettings).Assembly,
37+
typeof(System.Collections.IList).Assembly,
38+
typeof(System.Collections.Generic.IEnumerable<>).Assembly,
3539
typeof(System.Linq.Enumerable).Assembly,
3640
typeof(System.Linq.Expressions.Expression).Assembly,
3741
Assembly.Load(new AssemblyName("netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"))
@@ -46,6 +50,8 @@ public RazorEngineCompilationOptions()
4650
Assembly.Load(new AssemblyName("Microsoft.CSharp")),
4751
typeof(RazorEngineTemplateBase).Assembly,
4852
Assembly.Load(new AssemblyName("System.Runtime")),
53+
typeof(System.Collections.IList).Assembly,
54+
typeof(System.Collections.Generic.IEnumerable<>).Assembly,
4955
Assembly.Load(new AssemblyName("System.Linq")),
5056
Assembly.Load(new AssemblyName("System.Linq.Expressions")),
5157
Assembly.Load(new AssemblyName("netstandard"))
@@ -60,6 +66,8 @@ public RazorEngineCompilationOptions()
6066
Assembly.Load(new AssemblyName("Microsoft.CSharp")),
6167
typeof(RazorEngineTemplateBase).Assembly,
6268
Assembly.Load(new AssemblyName("System.Runtime")),
69+
typeof(System.Collections.IList).Assembly,
70+
typeof(System.Collections.Generic.IEnumerable<>).Assembly,
6371
Assembly.Load(new AssemblyName("System.Linq")),
6472
Assembly.Load(new AssemblyName("System.Linq.Expressions")),
6573
Assembly.Load(new AssemblyName("netstandard"))

0 commit comments

Comments
 (0)