You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// <summary>A helper for dependency injection.</summary>
15
+
/// <remarks>This class uses reflection to access the DI container since it can't directly reference the main DotNetNuke.Library project.</remarks>
14
16
internalstaticclassDependencyInjection
15
17
{
16
18
privatestaticreadonlyTypeCommonGlobalsType;
@@ -28,13 +30,19 @@ static DependencyInjection()
28
30
}
29
31
}
30
32
33
+
/// <summary>Gets the current service scope, or creates a service scope if there isn't one already created. The scope must be disposed by the caller.</summary>
34
+
/// <returns>A service scope.</returns>
35
+
/// <exception cref="InvalidOperationException">The expected method in <c>DotNetNuke.Common.Globals</c> does not exist.</exception>
vargetOrCreateServiceScopeMethod=CommonGlobalsType.GetMethod("GetOrCreateServiceScope",BindingFlags.NonPublic|BindingFlags.Static)??thrownewInvalidOperationException("Unable to retrieve Globals.GetOrCreateServiceScope method via reflection");
vargetCurrentServiceProviderMethod=CommonGlobalsType.GetMethod("GetCurrentServiceProvider",BindingFlags.NonPublic|BindingFlags.Static)??thrownewInvalidOperationException("Unable to retrieve Globals.GetCurrentServiceProvider method via reflection");
0 commit comments