Soenneker.Graph.Client 11.0.1809

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Graph.Client --version 11.0.1809
                    
NuGet\Install-Package Soenneker.Graph.Client -Version 11.0.1809
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Graph.Client" Version="11.0.1809" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Graph.Client" Version="11.0.1809" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Graph.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Graph.Client --version 11.0.1809
                    
#r "nuget: Soenneker.Graph.Client, 11.0.1809"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Graph.Client@11.0.1809
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Graph.Client&version=11.0.1809
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Graph.Client&version=11.0.1809
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

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 Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
11.0.1830 103 11/23/2026
11.0.1829 122 11/19/2026
11.0.1826 139 11/18/2026
11.0.1825 193 11/11/2026
11.0.1824 129 11/11/2026
11.0.1823 111 11/11/2026
11.0.1822 107 11/11/2026
11.0.1821 115 11/11/2026
11.0.1820 120 11/10/2026
11.0.1819 134 11/10/2026
11.0.1818 113 11/9/2026
11.0.1817 203 11/3/2026
11.0.1816 181 10/27/2026
11.0.1815 123 10/26/2026
11.0.1814 119 10/26/2026
11.0.1812 120 10/26/2026
11.0.1811 114 10/26/2026
11.0.1810 126 10/26/2026
11.0.1809 104 10/26/2026
4.0.1806 128 10/25/2026
Loading failed

Update dependency Soenneker.Utils.AsyncSingleton to v11 (#2372)