Skip to content

Commit 833390f

Browse files
committed
formatting
1 parent 50db5fa commit 833390f

File tree

2 files changed

+19
-28
lines changed

2 files changed

+19
-28
lines changed

RazorEngineCore/RazorEngineCompilationOptions.cs

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,32 @@ namespace RazorEngineCore
77
{
88
public class RazorEngineCompilationOptions
99
{
10-
private HashSet<Assembly> _referencedAssemblies;
11-
public HashSet<Assembly> ReferencedAssemblies {
12-
get
13-
{
14-
if (this._referencedAssemblies != null)
15-
return this._referencedAssemblies;
16-
17-
this._referencedAssemblies = new HashSet<Assembly>()
18-
{
19-
typeof(object).Assembly,
20-
Assembly.Load(new AssemblyName("Microsoft.CSharp")),
21-
typeof(RazorEngineTemplateBase).Assembly,
22-
Assembly.Load(new AssemblyName("System.Runtime")),
23-
Assembly.Load(new AssemblyName("System.Linq")),
24-
Assembly.Load(new AssemblyName("System.Linq.Expressions"))
25-
};
26-
27-
// Loading netstandard explicitly causes runtime error on Linux/OSX
28-
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
29-
{
30-
this._referencedAssemblies.Add(Assembly.Load(new AssemblyName("netstandard")));
31-
}
32-
33-
return this._referencedAssemblies;
34-
}
35-
}
10+
public HashSet<Assembly> ReferencedAssemblies { get; set; } = new HashSet<Assembly>()
11+
{
12+
typeof(object).Assembly,
13+
Assembly.Load(new AssemblyName("Microsoft.CSharp")),
14+
typeof(RazorEngineTemplateBase).Assembly,
15+
Assembly.Load(new AssemblyName("System.Runtime")),
16+
Assembly.Load(new AssemblyName("System.Linq")),
17+
Assembly.Load(new AssemblyName("System.Linq.Expressions"))
18+
};
3619

3720
public HashSet<MetadataReference> MetadataReferences { get; set; } = new HashSet<MetadataReference>();
38-
3921
public string TemplateNamespace { get; set; } = "TemplateNamespace";
4022
public string Inherits { get; set; } = "RazorEngineCore.RazorEngineTemplateBase";
4123

4224
public HashSet<string> DefaultUsings { get; set; } = new HashSet<string>()
4325
{
4426
"System.Linq"
4527
};
28+
29+
public RazorEngineCompilationOptions()
30+
{
31+
// Loading netstandard explicitly causes runtime error on Linux/OSX
32+
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
33+
{
34+
this.ReferencedAssemblies.Add(Assembly.Load(new AssemblyName("netstandard")));
35+
}
36+
}
4637
}
4738
}

RazorEngineCore/RazorEngineCore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<TargetFramework>netstandard2.0</TargetFramework>
44
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
55
<Version>2020.6.1</Version>
6-
<Authors>Alexander Selishchev, Simon Mourier, William David Cossey, Benjamin Smith</Authors>
6+
<Authors>Alexander Selishchev, Simon Mourier, William David Cossey, Benjamin Smith, Dag H. Baardsen</Authors>
77
<PackageProjectUrl>https://github.com/adoconnection/RazorEngineCore</PackageProjectUrl>
88
<Description>ASP.NET Core 3.1 Razor Template Engine</Description>
99
<AssemblyVersion>2020.6.1.0</AssemblyVersion>

0 commit comments

Comments
 (0)