dotnet / dotnet/EntityFramework.Docs

IMaterializationInterceptor instance registration info

Open
#4,403 1 comment 0 reactions 0 assignees View on GitHub
area-query
Dominant language
Mermaid
Stars
1.7k
Forks
2k
Avg merge
7d 23h
Merged PRs (30d)
16

Description

Please make developers aware that the IMaterializationInterceptor should be registered with a single (static) instance to avoid Microsoft.EntityFrameworkCore.Infrastructure.ManyServiceProvidersCreatedWarning issues.
See https://stackoverflow.com/questions/75601346/adding-interceptor-in-dbcontext-gives-microsoft-entityframeworkcore-infrastructu

---
#### Document Details

⚠ *Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.*

* ID: 3e828f66-5f1f-864e-f5aa-e90fa101fbf6
* Version Independent ID: 3e828f66-5f1f-864e-f5aa-e90fa101fbf6
* Content: [IMaterializationInterceptor Interface (Microsoft.EntityFrameworkCore.Diagnostics)](https://learn.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.diagnostics.imaterializationinterceptor?view=efcore-7.0)
* Content Source: [dotnet/xml/Microsoft.EntityFrameworkCore.Diagnostics/IMaterializationInterceptor.xml](https://github.com/dotnet/EntityFramework.ApiDocs/blob/live/dotnet/xml/Microsoft.EntityFrameworkCore.Diagnostics/IMaterializationInterceptor.xml)
* Product: **ef-core-api**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **avickers**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.