microsoftgraph / microsoftgraph/msgraph-sdk-dotnet

LegalHolds endpoint is not available in SDK

Open
#3,052 4 comments 0 reactions 1 assignee View on GitHub

@lramosvea is already working on this.

Since Mar 23, 2026.

type:bug
Dominant language
C#
Stars
789
Forks
264
Avg merge
15h 17m
Merged PRs (30d)
3

Description

Describe the bug

Documentation is here: https://learn.microsoft.com/en-us/graph/api/security-ediscoverycase-list-legalholds?view=graph-rest-1.0&tabs=csharp

This is a pretty straightforward issue. The SDK (likely all SDKs) do not recognize the endpoint.

When you try to use, you get a compile error:

'EdiscoveryCaseItemRequestBuilder' does not contain a definition for 'LegalHolds' and no accessible extension method 'LegalHolds' accepting a first argument of type 'EdiscoveryCaseItemRequestBuilder' could be found (are you missing a using directive or an assembly reference?)
var result = await graphClient.Security.Cases.EdiscoveryCases["{ediscoveryCase-id}"].LegalHolds.GetAsync();

I have a feeling this is broken for all SDKs because when you use the GraphExplorer, the endpoint doesn't autocomplete. On the bright side, the endpoint is alive and active because you can type the full name and it will work.

Expected behavior

The SDK to include released endpoints and supporting objects.

How to reproduce
  1. Create a new dotnet console app
  2. dotnet add Microsoft.Graph
  3. var result = await graphClient.Security.Cases.EdiscoveryCases["<caseId"].LegalHolds.GetAsync();

RESULTS:
'EdiscoveryCaseItemRequestBuilder' does not contain a definition for 'LegalHolds' and no accessible extension method 'LegalHolds' accepting a first argument of type 'EdiscoveryCaseItemRequestBuilder' could be found (are you missing a using directive or an assembly reference?)

SDK Version

5.100.0

Latest version known to work for scenario above?

None

Known Workarounds

Use the beta endpoint :(.

Debug output
Click to expand log ```
</details>


### Configuration

- OS: Windows 11
- Architecture: Arm64

### Other information

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.