Skip to content

Commit

Permalink
Compiler directives
Browse files Browse the repository at this point in the history
  • Loading branch information
jtkech committed Aug 18, 2023
1 parent 2be899f commit 65e89c5
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.Metrics;
using System.IO;
using System.Linq;
using Microsoft.AspNetCore.Authentication;
Expand Down Expand Up @@ -64,6 +63,7 @@ public static class ServiceCollectionExtensions
.Select(sd => sd.GetImplementationType()))
.ToArray();

#if NET8_0_OR_GREATER
/// <summary>
/// Metrics singletons used to isolate tenants from the host.
/// </summary>
Expand All @@ -72,6 +72,7 @@ public static class ServiceCollectionExtensions
.Where(sd => sd.Lifetime == ServiceLifetime.Singleton)
.Select(sd => sd.GetImplementationType())
.ToArray();
#endif

/// <summary>
/// Adds OrchardCore services to the host service collection.
Expand Down Expand Up @@ -99,7 +100,9 @@ public static OrchardCoreBuilder AddOrchardCore(this IServiceCollection services
AddExtensionServices(builder);
AddStaticFiles(builder);

#if NET8_0_OR_GREATER
AddMetrics(builder);
#endif
AddRouting(builder);
IsolateHttpClient(builder);
AddEndpointsApiExplorer(builder);
Expand Down Expand Up @@ -281,6 +284,7 @@ private static void AddStaticFiles(OrchardCoreBuilder builder)
});
}

#if NET8_0_OR_GREATER
/// <summary>
/// Adds isolated tenant level routing services.
/// </summary>
Expand Down Expand Up @@ -309,6 +313,7 @@ sd is ClonedSingletonDescriptor &&
},
order: Int32.MinValue + 100);
}
#endif

/// <summary>
/// Adds isolated tenant level routing services.
Expand Down

0 comments on commit 65e89c5

Please sign in to comment.