dotnet / dotnet/efcore

Intercept resolution of entity type

Open
#34,765 3 comments 0 reactions 0 assignees View on GitHub
area-interception area-query customer-reported needs-design
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

`IMaterializationInterceptor` allows the interception of individual entity materialization. Conceptually there must be a preceding step where EF resolves the entity type that a database row will be materialized into. It may be useful to intercept that type resolution.

My use case for this feature would be to examine authorization attributes on the entity type and throw an exception if the current user is not authorized to access that entity type. I'm currently doing this experimentally with an `IMaterializationInterceptor`. This feature request is based on the possibly incorrect assumption that type resolution only occurs once for a result set, as opposed to materialization which occurs once for every row. My entire use case may prove to be a stupid idea, but there may be more legitimate use cases for a type resolution interceptor.

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.