Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ You can view the [README](https://github.com/microsoft/kiota/blob/main/README.md

For the purposes of the .Net client library, the generator runs through an openApi file generated from the CSDL document file published by Microsoft Graph (https://graph.microsoft.com/beta/$metadata) and builds up an in-memory list of models.

The generation settings in `src/Microsoft.Graph/Generated/kiota-lock.json` exclude `/me` and `/me/**`.
Keep these exclusions when regenerating: the handwritten `GraphServiceClient.Me` reuses the
`Users.Item` request builders with the placeholder user ID defined by
`CoreConstants.ReplacementConstants.UserIdTokenToReplace`. Microsoft.Graph.Core rewrites that
synthetic `/users/TokenToReplace` path to `/me` when sending requests, including batch steps;
it does not look up the signed-in user's ID. `/education/me` is not excluded.

Regeneration requires the matching OpenAPI document referenced by `descriptionLocation` in the
lock file and its recorded Kiota version. With those available, run
`kiota update -o src\Microsoft.Graph\Generated` from the repository root. Build and run the unit
tests with `dotnet test tests\Microsoft.Graph.DotnetCore.Test\Microsoft.Graph.DotnetCore.Test.csproj`.

### When new features are added to the library
Generation happens as part of a manual process that occurs once a significant change or set of changes has been added to the Graph. This may include:
- A new workload comes to beta of Graph (Microsoft Teams, Batching, etc.)
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,25 @@ To install the client library via NuGet:

The Beta library is generated with the `Microsoft.Graph.Beta` namespace. This means that it can be used alongside the V1 package by using the `Microsoft.Graph` namespace while using the `Microsoft.Graph.Beta` namespace from the beta library.

### Signed-in user requests

`graphClient.Me` reuses `Microsoft.Graph.Beta.Users.Item.UserItemRequestBuilder`. Fluent calls
such as `graphClient.Me.Messages.GetAsync()` still target `/me`; no user ID lookup is needed.
Explicit request-builder, request-body, response, and request-configuration types previously
under `Microsoft.Graph.Beta.Me` must instead use their equivalents under
`Microsoft.Graph.Beta.Users.Item` (for example, `Users.Item.SendMail.SendMailPostRequestBody`).
`BaseGraphServiceClient` no longer exposes `Me`; use `GraphServiceClient` for this entry point.

This requires Microsoft.Graph.Core with `CoreConstants.ReplacementConstants.UserIdTokenToReplace`
and Graph URI replacement support, including batch-step replacement. The existing `4.*`
dependency must resolve to a core release containing those changes before this SDK is published.
`ToGetRequestInformation()` and other request-information methods expose the synthetic
`/users/TokenToReplace` path; the default Graph HTTP pipeline rewrites it to `/me` when sending.
Custom HTTP clients should be created with `GraphClientFactory.Create()`, or include
`new UriReplacementHandler<GraphUriReplacementHandlerOption>(new GraphUriReplacementHandlerOption())`
from Microsoft.Kiota.Http.HttpClientLibrary.Middleware and Microsoft.Graph respectively.
Custom request adapters must provide the equivalent remapping if they do not use that pipeline.

## Getting started

Please see [msgraph-sdk-dotnet](https://github.com/microsoftgraph/msgraph-sdk-dotnet) for information on getting started with this library.
Expand Down
6 changes: 0 additions & 6 deletions src/Microsoft.Graph/Generated/BaseGraphServiceClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
using Microsoft.Graph.Beta.IdentityProviders;
using Microsoft.Graph.Beta.InformationProtection;
using Microsoft.Graph.Beta.Invitations;
using Microsoft.Graph.Beta.Me;
using Microsoft.Graph.Beta.MessageEvents;
using Microsoft.Graph.Beta.MessageRecipients;
using Microsoft.Graph.Beta.MessageTraces;
Expand Down Expand Up @@ -472,11 +471,6 @@ public partial class BaseGraphServiceClient : BaseRequestBuilder
{
get => new global::Microsoft.Graph.Beta.Invitations.InvitationsRequestBuilder(PathParameters, RequestAdapter);
}
/// <summary>Provides operations to manage the user singleton.</summary>
public global::Microsoft.Graph.Beta.Me.MeRequestBuilder Me
{
get => new global::Microsoft.Graph.Beta.Me.MeRequestBuilder(PathParameters, RequestAdapter);
}
/// <summary>Provides operations to manage the collection of messageEvent entities.</summary>
public global::Microsoft.Graph.Beta.MessageEvents.MessageEventsRequestBuilder MessageEvents
{
Expand Down

This file was deleted.

Loading
Loading