Soenneker.Graph.Client 4.0.1733

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 4.0.1733
                    
NuGet\Install-Package Soenneker.Graph.Client -Version 4.0.1733
                    
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="4.0.1733" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Graph.Client" Version="4.0.1733" />
                    
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 4.0.1733
                    
#r "nuget: Soenneker.Graph.Client, 4.0.1733"
                    
#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@4.0.1733
                    
#: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=4.0.1733
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Graph.Client&version=4.0.1733
                    
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 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. 
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
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
Loading failed

Updated NuGet packages