Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Nov 21, 2024
1 parent ddb605e commit b7e23ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ EfGraphQLConventions.RegisterInContainer<MyDbContext>(
serviceCollection,
model: ModelBuilder.GetInstance());
```
<sup><a href='/src/Snippets/Configuration.cs#L18-L22' title='Snippet source file'>snippet source</a> | <a href='#snippet-RegisterInContainer-1' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Snippets/Configuration.cs#L17-L21' title='Snippet source file'>snippet source</a> | <a href='#snippet-RegisterInContainer-1' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down Expand Up @@ -132,7 +132,7 @@ EfGraphQLConventions.RegisterInContainer<MyDbContext>(
serviceCollection,
model: ModelBuilder.GetInstance());
```
<sup><a href='/src/Snippets/Configuration.cs#L18-L22' title='Snippet source file'>snippet source</a> | <a href='#snippet-RegisterInContainer-1' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Snippets/Configuration.cs#L17-L21' title='Snippet source file'>snippet source</a> | <a href='#snippet-RegisterInContainer-1' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Then the `IEfGraphQLService` can be resolved via [dependency injection in GraphQL.net](https://graphql-dotnet.github.io/docs/guides/advanced#dependency-injection) to be used in `ObjectGraphType`s when adding query fields.
Expand Down
9 changes: 4 additions & 5 deletions src/Snippets/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ public static IModel GetInstance()
}
#endregion

static void RegisterInContainerExplicit(IServiceCollection serviceCollection)
{
#region RegisterInContainer
static void RegisterInContainerExplicit(IServiceCollection serviceCollection) =>
#region RegisterInContainer
EfGraphQLConventions.RegisterInContainer<MyDbContext>(
serviceCollection,
model: ModelBuilder.GetInstance());
#endregion
}
#endregion


public class MyDbContext(DbContextOptions options) :
DbContext(options);
Expand Down

0 comments on commit b7e23ef

Please sign in to comment.