-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Custom mapping interceptor #2126
Comments
Can you perhaps give a more concrete example of what you're looking for? I suspect the answer is "not really", but if there's merit in the need, we might be able to sort something. |
Similar issues/screnario i've found #360 #503 As for #503, how can we inject key information for encrypt/decrypt operation? since dapper control the instantiation of the class. |
I wonder if the solution here - in the future, not fully usable right now - would be to use the DapperAOT TypeHandler<....> API. We could tweak this to allow it to be specified on individual members (fields/properties), so that you can enable it on some columns and not others, via attributes. Thoughts? Note this won't work "today" - it needs more work. As for passing keys: I would assume |
I haven't look through Dapper AOT, will check it later. My assumption, by controlling via attributes, api user still need some context to pass around, to check whether current app user has the right policy to access the data, here is the background we would like to achieve
Please point out some area that i need to look, i'll try to help if i could. |
Async local is probably the most appropriate solution for ambient state, in the absence of a dedicated state API/parameter (separate to args); ok terms of usage: just set it once the context of your request/whatever - typically right at the start after authenticating, and: that's it |
well received, thanks @mgravell, closing for now. |
Hi, is there any way to intercept mapping while setting field/property value with some user provided context? In our case, we need to do some masking to several properties given some current user policy doing the query. Currently, we loop through materialized data, and re-set maksed property.
The text was updated successfully, but these errors were encountered: