Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/GraphQL.DI/GraphQLBuilderExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Reflection;
using System.Runtime.CompilerServices;

namespace GraphQL.DI;

Expand All @@ -22,6 +23,7 @@ public static IGraphQLBuilder AddDIGraphTypes(this IGraphQLBuilder builder)
/// Scans the calling assembly for classes that implement <see cref="IDIObjectGraphBase{TSource}"/>
/// and registers them as transients within the DI container.
/// </summary>
[MethodImpl(MethodImplOptions.NoInlining)] // inlining would change result of GetCallingAssembly
public static IGraphQLBuilder AddDIGraphBases(this IGraphQLBuilder builder)
=> AddDIGraphBases(builder, Assembly.GetCallingAssembly());

Expand All @@ -46,6 +48,7 @@ public static IGraphQLBuilder AddDIGraphBases(this IGraphQLBuilder builder, Asse
/// the <see cref="DoNotMapClrTypeAttribute"/>, 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.
/// </summary>
[MethodImpl(MethodImplOptions.NoInlining)] // inlining would change result of GetCallingAssembly
public static IGraphQLBuilder AddDIClrTypeMappings(this IGraphQLBuilder builder)
=> AddDIClrTypeMappings(builder, Assembly.GetCallingAssembly());

Expand Down
2 changes: 2 additions & 0 deletions src/GraphQL.DI/GraphQLDIBuilderExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using GraphQL.DI;

namespace GraphQL;
Expand Down Expand Up @@ -29,6 +30,7 @@ public static class GraphQLDIBuilderExtensions
/// </item>
/// </list>
/// </summary>
[MethodImpl(MethodImplOptions.NoInlining)] // inlining would change result of GetCallingAssembly
public static IGraphQLBuilder AddDI(this IGraphQLBuilder builder)
=> AddDI(builder, Assembly.GetCallingAssembly());

Expand Down
Loading