diff --git a/src/GraphQL.DI/GraphQLBuilderExtensions.cs b/src/GraphQL.DI/GraphQLBuilderExtensions.cs index 29f44f8..8dc9259 100644 --- a/src/GraphQL.DI/GraphQLBuilderExtensions.cs +++ b/src/GraphQL.DI/GraphQLBuilderExtensions.cs @@ -1,4 +1,5 @@ using System.Reflection; +using System.Runtime.CompilerServices; namespace GraphQL.DI; @@ -22,6 +23,7 @@ public static IGraphQLBuilder AddDIGraphTypes(this IGraphQLBuilder builder) /// Scans the calling assembly for classes that implement /// and registers them as transients within the DI container. /// + [MethodImpl(MethodImplOptions.NoInlining)] // inlining would change result of GetCallingAssembly public static IGraphQLBuilder AddDIGraphBases(this IGraphQLBuilder builder) => AddDIGraphBases(builder, Assembly.GetCallingAssembly()); @@ -46,6 +48,7 @@ public static IGraphQLBuilder AddDIGraphBases(this IGraphQLBuilder builder, Asse /// the , or where another graph type would be automatically mapped /// to the specified type, or where a graph type has already been registered to the specified clr type. /// + [MethodImpl(MethodImplOptions.NoInlining)] // inlining would change result of GetCallingAssembly public static IGraphQLBuilder AddDIClrTypeMappings(this IGraphQLBuilder builder) => AddDIClrTypeMappings(builder, Assembly.GetCallingAssembly()); diff --git a/src/GraphQL.DI/GraphQLDIBuilderExtensions.cs b/src/GraphQL.DI/GraphQLDIBuilderExtensions.cs index 9cd5110..f82b4b9 100644 --- a/src/GraphQL.DI/GraphQLDIBuilderExtensions.cs +++ b/src/GraphQL.DI/GraphQLDIBuilderExtensions.cs @@ -1,4 +1,5 @@ using System.Reflection; +using System.Runtime.CompilerServices; using GraphQL.DI; namespace GraphQL; @@ -29,6 +30,7 @@ public static class GraphQLDIBuilderExtensions /// /// /// + [MethodImpl(MethodImplOptions.NoInlining)] // inlining would change result of GetCallingAssembly public static IGraphQLBuilder AddDI(this IGraphQLBuilder builder) => AddDI(builder, Assembly.GetCallingAssembly());