Skip to content

Intercept resolution of entity type #34765

@kjkrum

Description

@kjkrum

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions