-
Notifications
You must be signed in to change notification settings - Fork 57
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
Use IncludeGraphOperationBuilder
in combination with global PostConfiguration
option
#543
Comments
Hello @meinsiedler , At this moment, it is indeed impossible to set a It's more for security purposes than anything else, as we could easily support it. Here is a solution that add this code in the builder instead: https://dotnetfiddle.net/6eX0X4 await context.Invoices.BulkMergeAsync(invoices, opts =>
{
opts.IncludeGraph = true;
opts.IncludeGraphOperationBuilder = bulkOperation =>
{
// Just for testing: Assume we have some special IncludeGraphOperationBuilder config for one specific call to BulkMergeAsync
if (bulkOperation is BulkOperation<InvoiceItem> invoiceItemBulkOperation)
{
invoiceItemBulkOperation.IgnoreOnMergeUpdateExpression = invoiceItem => new
{
invoiceItem.Description
};
}
bulkOperation.PostConfiguration = postConfigurationBulkOperation => ConfigureModifiedByUserIdColumnMapping(postConfigurationBulkOperation);
};
}); You can ask for it if you really need to set it globally. If that's the case, I will ask my architect how we could potentially allow this kind of scenario, such as allowing it when Let me also know if that shows correctly the cause and solution of this issue. Best Regards, Jon |
Hello @JonathanMagnan , thank you for your response and for your efforts regarding this topic. Ideally, we would really like to set up the configuration of the
I don't quite understand, why the exeption throwing behaves differently when just passing (This different behavior of both calls to |
Hello @meinsiedler , Sure, we will look into this to allow this options to be global. I will try to remember to give you the reason after the internal discussion we will have about this issue next Monday why they behave differently. |
Hello @JonathanMagnan , do you have any updates regarding this issue? Thank you. |
Hello @meinsiedler , We made some progress on this issue, such as better understanding our current different behaviors. One problem with We will investigate more this week about what can be done (We have been a little bit to busy past 2 weeks). |
Hello @JonathanMagnan , do you have any further updates regarding this issue? We were investigating different options we have when I created this issue and now we would like to bring this feature to production. Is is foreseeable that something will be changed to support our use case? If not we need to find another, non-generic way to set the modified columns, e.g. via custom extension methods. This wouldn't be our preferred option. Thank you. |
Description
This is a follow-up issue/question to #542 .
We set up a column mappping for shadow properties which are automatically set when performing any bulk operation like
BulkInsert
,BulkMerge
. This setup is performed globally using theEntityFrameworkManager.BulkOperationBuilder
. This now works great also with the newIncludeGraph
option from the new version 7.100.0.But when we use the global setup in combination with the
IncludeGraphOperationBuilder
, we receive the following exception. When we don't use theIncludeGraphOperationBuilder
, our code works even when using the newIncludeGraph
option.Is this expected behavior or should it be possible to setup the
PostConfiguration
globally even when using theIncludeGraphOerationBuilder
?Please see the linked Fiddle for more details and a repro of the issue.
Exception
If you are seeing an exception, include the full exceptions details (message and stack trace).
Fiddle or Project (Optional)
https://dotnetfiddle.net/KEpQtr
Further technical details
The text was updated successfully, but these errors were encountered: