Soenneker.Graph.Client
4.0.1732
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Graph.Client --version 4.0.1732
NuGet\Install-Package Soenneker.Graph.Client -Version 4.0.1732
<PackageReference Include="Soenneker.Graph.Client" Version="4.0.1732" />
<PackageVersion Include="Soenneker.Graph.Client" Version="4.0.1732" />
<PackageReference Include="Soenneker.Graph.Client" />
paket add Soenneker.Graph.Client --version 4.0.1732
#r "nuget: Soenneker.Graph.Client, 4.0.1732"
#:package Soenneker.Graph.Client@4.0.1732
#addin nuget:?package=Soenneker.Graph.Client&version=4.0.1732
#tool nuget:?package=Soenneker.Graph.Client&version=4.0.1732
Soenneker.Graph.Client
A lazy, thread-safe GraphServiceClient provider using Microsoft Entra client-credential authentication.
Install
dotnet add package Soenneker.Graph.Client
Configuration
{
"Azure": {
"AzureAd": {
"TenantId": "<tenant ID>",
"ClientId": "<application client ID>",
"ClientSecret": "<client secret>"
}
}
}
These values are read when the provider is constructed. The app registration needs application permissions for the Graph operations your application performs, with tenant admin consent where required.
Register
using Soenneker.Graph.Client.Registrars;
using Microsoft.Extensions.DependencyInjection;
services.AddGraphClientUtilAsSingleton();
Singleton registration is the normal ownership boundary: scoped Graph utilities can be disposed while the authenticated client remains available to later scopes. AddGraphClientUtilAsScoped() is available when a separate client is deliberately required per scope.
Usage
using Microsoft.Graph;
using Microsoft.Graph.Models;
GraphServiceClient graph = await graphClientUtil.Get(cancellationToken);
UserCollectionResponse? page = await graph.Users.GetAsync(
cancellationToken: cancellationToken);
Every Get() call on the same provider returns the same lazily created client. Authentication uses the application identity, not an interactive or delegated user login.
API at a glance
| API | What it does | Result / important behavior |
|---|---|---|
Get(cancellationToken) |
Gets or creates the authenticated Graph client. | Cached for the provider lifetime. |
AddGraphClientUtilAsSingleton() |
Registers one client provider application-wide. | Intended dependency for scoped Graph utilities. |
AddGraphClientUtilAsScoped() |
Registers a separate provider per scope. | Scope disposal also disposes that scope's client. |
Practical notes
- Cancellation can stop pending lazy initialization and should also be passed to individual Graph SDK requests.
- Let the DI container dispose registered providers. Dispose manually constructed providers yourself.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Azure.Identity (>= 1.21.0)
- Microsoft.Graph (>= 6.5.0)
- Soenneker.Extensions.Configuration (>= 4.0.871)
- Soenneker.Utils.AsyncSingleton (>= 4.0.829)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.Graph.Client:
| Package | Downloads |
|---|---|
|
Soenneker.Graph.Users
Microsoft Graph user creation, update, lookup, paging, and queued deletion operations. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.1734 | 0 | 8/31/2026 |
| 4.0.1733 | 0 | 8/31/2026 |
| 4.0.1732 | 0 | 8/31/2026 |
| 4.0.1731 | 0 | 8/31/2026 |
| 4.0.1730 | 36 | 8/31/2026 |
| 4.0.1729 | 47 | 8/30/2026 |
| 4.0.1728 | 38 | 8/30/2026 |
| 4.0.1727 | 46 | 8/30/2026 |
| 4.0.1726 | 39 | 8/30/2026 |
| 4.0.1725 | 38 | 8/30/2026 |
| 4.0.1724 | 65 | 8/30/2026 |
| 4.0.1723 | 38 | 8/29/2026 |
| 4.0.1722 | 141 | 8/29/2026 |
| 4.0.1721 | 41 | 8/29/2026 |
| 4.0.1720 | 38 | 8/29/2026 |
| 4.0.1719 | 116 | 8/26/2026 |
| 4.0.1718 | 61 | 8/26/2026 |
| 4.0.1717 | 102 | 8/25/2026 |
| 4.0.1716 | 136 | 8/21/2026 |
| 4.0.1715 | 387 | 8/18/2026 |
Updated NuGet packages