Skip to content
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

Allow to configure a property as non-persisted only for a specific mapping #33676

Open
Tracked by #22959 ...
jacontre opened this issue May 3, 2024 · 4 comments
Open
Tracked by #22959 ...

Comments

@jacontre
Copy link

jacontre commented May 3, 2024

Is there a way to use InsertUsingStoredProcedure and UpdateUsingStoredProcedure with the same entity and configure it so that I can ignore a property on Update that is not used. Our example is using a CreatedDateTime and LastModifiedTime where both are used in the Insert procedure but then CreatedDateTime is not passed into the update procedure and we would like to ignore it for that case.

@AndriySvyryd
Copy link
Member

AndriySvyryd commented May 15, 2024

This depends on #14121
Related to #28436

@AndriySvyryd AndriySvyryd changed the title Ignore property in Model builder entity for Update procedure only Allow to configure a property as non-persisted only for sproc mapping May 15, 2024
@AndriySvyryd AndriySvyryd added this to the Backlog milestone Jun 13, 2024
@AndriySvyryd AndriySvyryd changed the title Allow to configure a property as non-persisted only for sproc mapping Allow to configure a property as non-persisted only for a specific mapping Sep 19, 2024
@bytefish
Copy link

bytefish commented Oct 1, 2024

@AndriySvyryd Is there any way to work around this issue, so we could ignore a field, when using InsertUsingStoredProcedure? Maybe it's sufficient in a first step to remove the validation, which requires all fields to be defined as a Parameter, because this clearly doesn't hold for any entity with computed fields.

@AndriySvyryd
Copy link
Member

@bytefish No, I can't think of a way around this currently, apart from adding a dummy parameter to the sproc.

@bytefish
Copy link

bytefish commented Oct 3, 2024

@AndriySvyryd Thanks for the confirmation and thanks for your work on EF Core! 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants